summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRandy Pan <zpan@google.com>2016-10-06 17:19:04 +0000
committerandroid-build-merger <android-build-merger@google.com>2016-10-06 17:19:04 +0000
commit0dc93bd75db059a5ca57a9b430a577c3a5a28ded (patch)
treea1f31e2b0ba4673b6da180ab7e7fcb96399196cf /tests
parent98783540c168477caeb01cc95c9b3645eafd8995 (diff)
parentb9705ab138923ebd4724ed9b428c706339d93af6 (diff)
WCM: unit tests
am: b9705ab138 Change-Id: I38888e7e79f743abc7cd8fb2f3481779653549fb
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java32
1 files changed, 16 insertions, 16 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java b/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
index 84133acb7..c952f65ff 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiConnectivityManagerTest.java
@@ -72,7 +72,7 @@ public class WifiConnectivityManagerTest {
mWifiConfigManager = mockWifiConfigManager();
mWifiInfo = getWifiInfo();
mWifiScanner = mockWifiScanner();
- mWifiQNS = mockWifiQualifiedNetworkSelector();
+ mWifiNS = mockWifiNetworkSelector();
mWifiConnectivityManager = createConnectivityManager();
mWifiConnectivityManager.setWifiEnabled(true);
when(mClock.getElapsedSinceBootMillis()).thenReturn(SystemClock.elapsedRealtime());
@@ -91,7 +91,7 @@ public class WifiConnectivityManagerTest {
private TestAlarmManager mAlarmManager;
private TestLooper mLooper = new TestLooper();
private WifiConnectivityManager mWifiConnectivityManager;
- private WifiQualifiedNetworkSelector mWifiQNS;
+ private WifiNetworkSelector mWifiNS;
private WifiStateMachine mWifiStateMachine;
private WifiScanner mWifiScanner;
private WifiConfigManager mWifiConfigManager;
@@ -117,10 +117,10 @@ public class WifiConnectivityManagerTest {
R.bool.config_wifi_framework_enable_associated_network_selection)).thenReturn(true);
when(resource.getInteger(
R.integer.config_wifi_framework_wifi_score_good_rssi_threshold_24GHz))
- .thenReturn(WifiQualifiedNetworkSelector.RSSI_SATURATION_2G_BAND);
+ .thenReturn(-60);
when(resource.getInteger(
R.integer.config_wifi_framework_current_network_boost))
- .thenReturn(WifiQualifiedNetworkSelector.SAME_NETWORK_AWARD);
+ .thenReturn(16);
return resource;
}
@@ -197,8 +197,8 @@ public class WifiConnectivityManagerTest {
return stateMachine;
}
- WifiQualifiedNetworkSelector mockWifiQualifiedNetworkSelector() {
- WifiQualifiedNetworkSelector qns = mock(WifiQualifiedNetworkSelector.class);
+ WifiNetworkSelector mockWifiNetworkSelector() {
+ WifiNetworkSelector ns = mock(WifiNetworkSelector.class);
WifiConfiguration candidate = generateWifiConfig(
0, CANDIDATE_NETWORK_ID, CANDIDATE_SSID, false, true, null, null);
@@ -208,9 +208,9 @@ public class WifiConnectivityManagerTest {
candidateScanResult.BSSID = CANDIDATE_BSSID;
candidate.getNetworkSelectionStatus().setCandidate(candidateScanResult);
- when(qns.selectQualifiedNetwork(anyBoolean(), anyBoolean(), anyBoolean(),
- anyBoolean(), anyBoolean(), anyBoolean(), anyObject())).thenReturn(candidate);
- return qns;
+ when(ns.selectNetwork(anyObject(), anyBoolean(), anyBoolean(),
+ anyBoolean())).thenReturn(candidate);
+ return ns;
}
WifiInfo getWifiInfo() {
@@ -250,7 +250,7 @@ public class WifiConnectivityManagerTest {
WifiConnectivityManager createConnectivityManager() {
return new WifiConnectivityManager(mContext, mWifiStateMachine, mWifiScanner,
- mWifiConfigManager, mWifiInfo, mWifiQNS, mWifiInjector, mLooper.getLooper(), true);
+ mWifiConfigManager, mWifiInfo, mWifiNS, mWifiInjector, mLooper.getLooper(), true);
}
/**
@@ -490,9 +490,9 @@ public class WifiConnectivityManagerTest {
* because of their low RSSI values.
*/
@Test
- public void PnoRetryForLowRssiNetwork() {
- when(mWifiQNS.selectQualifiedNetwork(anyBoolean(), anyBoolean(), anyBoolean(),
- anyBoolean(), anyBoolean(), anyBoolean(), anyObject())).thenReturn(null);
+ public void pnoRetryForLowRssiNetwork() {
+ when(mWifiNS.selectNetwork(anyObject(), anyBoolean(), anyBoolean(),
+ anyBoolean())).thenReturn(null);
// Set screen to off
mWifiConnectivityManager.handleScreenStateChanged(false);
@@ -511,7 +511,7 @@ public class WifiConnectivityManagerTest {
.getLowRssiNetworkRetryDelay();
assertEquals(lowRssiNetworkRetryDelayStartValue * 2,
- lowRssiNetworkRetryDelayAfterPnoValue);
+ lowRssiNetworkRetryDelayAfterPnoValue);
}
/**
@@ -546,8 +546,8 @@ public class WifiConnectivityManagerTest {
@Test
public void watchdogBitePnoGoodIncrementsMetrics() {
// Qns returns no candidate after watchdog single scan.
- when(mWifiQNS.selectQualifiedNetwork(anyBoolean(), anyBoolean(), anyBoolean(),
- anyBoolean(), anyBoolean(), anyBoolean(), anyObject())).thenReturn(null);
+ when(mWifiNS.selectNetwork(anyObject(), anyBoolean(), anyBoolean(),
+ anyBoolean())).thenReturn(null);
// Set screen to off
mWifiConnectivityManager.handleScreenStateChanged(false);