Search in sources :

Example 1 with NetworkKey

use of android.net.NetworkKey in project platform_frameworks_base by android.

the class WifiNetworkScoreCacheTest method getMeteredHintShouldReturnTrue.

@Test
public void getMeteredHintShouldReturnTrue() {
    ScoredNetwork network = new ScoredNetwork(new NetworkKey(VALID_KEY), mockRssiCurve, true);
    mScoreCache.updateScores(ImmutableList.of(network));
    assertTrue(mScoreCache.getMeteredHint(VALID_SCAN_RESULT));
}
Also used : NetworkKey(android.net.NetworkKey) ScoredNetwork(android.net.ScoredNetwork) SmallTest(android.support.test.filters.SmallTest) Test(org.junit.Test)

Example 2 with NetworkKey

use of android.net.NetworkKey in project platform_frameworks_base by android.

the class NetworkScoreServiceTest method testRequestScores_providerThrowsRemoteException.

@Test
public void testRequestScores_providerThrowsRemoteException() throws Exception {
    injectProvider();
    doThrow(new RemoteException()).when(mRecommendationProvider).requestScores(any(NetworkKey[].class));
    assertFalse(mNetworkScoreService.requestScores(new NetworkKey[0]));
}
Also used : NetworkKey(android.net.NetworkKey) RemoteException(android.os.RemoteException) MediumTest(android.support.test.filters.MediumTest) Test(org.junit.Test)

Aggregations

NetworkKey (android.net.NetworkKey)2 Test (org.junit.Test)2 ScoredNetwork (android.net.ScoredNetwork)1 RemoteException (android.os.RemoteException)1 MediumTest (android.support.test.filters.MediumTest)1 SmallTest (android.support.test.filters.SmallTest)1