diff options
author | xinhe <xinhe@google.com> | 2016-01-14 17:03:50 -0800 |
---|---|---|
committer | xinhe <xinhe@google.com> | 2016-01-14 17:07:51 -0800 |
commit | 8f3ec73d1ce52b3f23e4cccd6a202b5707874f46 (patch) | |
tree | 629c25104d49a08eb0a4311aca6d18c50266312d /tests | |
parent | 21a7287737e8b2a122b07d63a7393868101a99a1 (diff) |
Broken WifiStateMachine and Network Selection Test
Fix the broken on Network Selection Test
BUG=26549815
Change-Id: I1e331c6c677b050b3625ca708c8513dcbd3c192f
Diffstat (limited to 'tests')
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/WifiQualifiedNetworkSelectionTest.java | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiQualifiedNetworkSelectionTest.java b/tests/wifitests/src/com/android/server/wifi/WifiQualifiedNetworkSelectionTest.java index 4fcdc4ea6..ca12d8aa3 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiQualifiedNetworkSelectionTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiQualifiedNetworkSelectionTest.java @@ -32,6 +32,7 @@ import org.junit.Test; import java.util.ArrayList; import java.util.List; +import java.util.concurrent.atomic.AtomicInteger; import static org.mockito.Mockito.any; import static org.mockito.Mockito.mock; @@ -69,9 +70,6 @@ public class WifiQualifiedNetworkSelectionTest { private WifiStateMachine getWifiStateMachine() { WifiStateMachine wifiStateMachine = mock(WifiStateMachine.class); - when(wifiStateMachine.isLinkDebouncing()).thenReturn(false); - when(wifiStateMachine.isSupplicantTransientState()).thenReturn(false); - return wifiStateMachine; } @@ -137,18 +135,19 @@ public class WifiQualifiedNetworkSelectionTest { WifiConfigStore getWifiConfigStore() { WifiConfigStore wifiConfigStore = mock(WifiConfigStore.class); - wifiConfigStore.thresholdSaturatedRssi24.set( + wifiConfigStore.thresholdSaturatedRssi24 = new AtomicInteger( WifiQualifiedNetworkSelector.RSSI_SATURATION_2G_BAND); - wifiConfigStore.bandAward5Ghz.set(WifiQualifiedNetworkSelector.BAND_AWARD_5GHz); - wifiConfigStore.currentNetworkBoost.set(WifiQualifiedNetworkSelector.SAME_NETWORK_AWARD); - wifiConfigStore.thresholdQualifiedRssi5.set( + wifiConfigStore.bandAward5Ghz = new AtomicInteger( + WifiQualifiedNetworkSelector.BAND_AWARD_5GHz); + wifiConfigStore.currentNetworkBoost = new AtomicInteger( + WifiQualifiedNetworkSelector.SAME_NETWORK_AWARD); + wifiConfigStore.thresholdQualifiedRssi5 = new AtomicInteger( WifiQualifiedNetworkSelector.QUALIFIED_RSSI_5G_BAND); - wifiConfigStore.thresholdMinimumRssi24.set( + wifiConfigStore.thresholdMinimumRssi24 = new AtomicInteger( WifiQualifiedNetworkSelector.MINIMUM_2G_ACCEPT_RSSI); - wifiConfigStore.thresholdMinimumRssi5.set( + wifiConfigStore.thresholdMinimumRssi5 = new AtomicInteger( WifiQualifiedNetworkSelector.MINIMUM_5G_ACCEPT_RSSI); - when(wifiConfigStore.getEnableNewNetworkSelectionWhenAssociated()).thenReturn(true); return wifiConfigStore; } @@ -203,6 +202,8 @@ public class WifiQualifiedNetworkSelectionTest { when(mWifiConfigStore.updateSavedNetworkWithNewScanDetail(scanDetails.get(1))).thenReturn( associateWithScanResult2); ScanResult scanResult = scanDetails.get(1).getScanResult(); + + mWifiQualifiedNetworkSelector.selectQualifiedNetwork(false); verify(mWifiStateMachine).sendMessage(WifiStateMachine.CMD_AUTO_ROAM, 1, 1, scanResult); } -}
\ No newline at end of file +} |