summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRebecca Silberstein <silberst@google.com>2018-01-31 00:51:50 -0800
committerRebecca Silberstein <silberst@google.com>2018-02-20 17:25:48 -0800
commit73dd0f219113f68ca1451b3a6ca48642f7775c82 (patch)
tree211b37cd30ea5dd38531709fe97604d4b5a6c990 /tests
parent9a50fce0dd19fa80a37c2f851772811f823685bd (diff)
WifiStateMachine: remove scan related code
Now that we have ScanRequestProxy hooked up with WifiServiceImpl, we no longer need scan request/result handling in WSM. Bug: 31444878 Bug: 31445200 Bug: 70359905 Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh Test: Wifi Integration tests Change-Id: I63ab7efe1f43310faf92c927c31bdcfa6d8bb7da
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java64
1 files changed, 0 insertions, 64 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java b/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java
index 7aeccbef6..29f8b4847 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java
@@ -108,9 +108,7 @@ import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
-import java.util.HashSet;
import java.util.List;
-import java.util.Set;
import java.util.concurrent.CountDownLatch;
import java.util.function.Consumer;
@@ -921,68 +919,6 @@ public class WifiStateMachineTest {
return null;
}
- private void verifyScan(int band, int reportEvents, Set<String> hiddenNetworkSSIDSet) {
- ArgumentCaptor<WifiScanner.ScanSettings> scanSettingsCaptor =
- ArgumentCaptor.forClass(WifiScanner.ScanSettings.class);
- ArgumentCaptor<WifiScanner.ScanListener> scanListenerCaptor =
- ArgumentCaptor.forClass(WifiScanner.ScanListener.class);
- verify(mWifiScanner).startScan(scanSettingsCaptor.capture(), scanListenerCaptor.capture(),
- eq(null));
- WifiScanner.ScanSettings actualSettings = scanSettingsCaptor.getValue();
- assertEquals("band", band, actualSettings.band);
- assertEquals("reportEvents", reportEvents, actualSettings.reportEvents);
-
- if (hiddenNetworkSSIDSet == null) {
- hiddenNetworkSSIDSet = new HashSet<>();
- }
- Set<String> actualHiddenNetworkSSIDSet = new HashSet<>();
- if (actualSettings.hiddenNetworks != null) {
- for (int i = 0; i < actualSettings.hiddenNetworks.length; ++i) {
- actualHiddenNetworkSSIDSet.add(actualSettings.hiddenNetworks[i].ssid);
- }
- }
- assertEquals("hidden networks", hiddenNetworkSSIDSet, actualHiddenNetworkSSIDSet);
-
- when(mWifiNative.getScanResults(WIFI_IFACE_NAME)).thenReturn(getMockScanResults());
- mWsm.sendMessage(WifiMonitor.SCAN_RESULTS_EVENT);
-
- mLooper.dispatchAll();
-
- List<ScanResult> reportedResults = mWsm.syncGetScanResultsList();
- assertEquals(8, reportedResults.size());
- }
-
- @Test
- public void scan() throws Exception {
- initializeAndAddNetworkAndVerifySuccess();
-
- mWsm.startScan(-1, 0, null, null);
- mLooper.dispatchAll();
-
- verifyScan(WifiScanner.WIFI_BAND_BOTH_WITH_DFS,
- WifiScanner.REPORT_EVENT_AFTER_EACH_SCAN
- | WifiScanner.REPORT_EVENT_FULL_SCAN_RESULT, null);
- }
-
- @Test
- public void scanWithHiddenNetwork() throws Exception {
- initializeAndAddNetworkAndVerifySuccess(true);
-
- Set<String> hiddenNetworkSet = new HashSet<>();
- hiddenNetworkSet.add(sSSID);
- List<WifiScanner.ScanSettings.HiddenNetwork> hiddenNetworkList = new ArrayList<>();
- hiddenNetworkList.add(new WifiScanner.ScanSettings.HiddenNetwork(sSSID));
- when(mWifiConfigManager.retrieveHiddenNetworkList()).thenReturn(hiddenNetworkList);
-
- mWsm.startScan(-1, 0, null, null);
- mLooper.dispatchAll();
-
- verifyScan(WifiScanner.WIFI_BAND_BOTH_WITH_DFS,
- WifiScanner.REPORT_EVENT_AFTER_EACH_SCAN
- | WifiScanner.REPORT_EVENT_FULL_SCAN_RESULT,
- hiddenNetworkSet);
- }
-
private void setupAndStartConnectSequence(WifiConfiguration config) throws Exception {
when(mWifiConfigManager.enableNetwork(eq(config.networkId), eq(true), anyInt()))
.thenReturn(true);