diff options
author | Sohani Rao <sohanirao@google.com> | 2017-08-17 15:08:13 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2017-08-17 15:08:13 +0000 |
commit | 73c4fead1c47e82431d117bffed6ea6c843b7980 (patch) | |
tree | 3aab6591a6670ad31acb351ce21600826dd716c0 /tests | |
parent | df083b113b3c07274507fd66ed87b2caffb070a4 (diff) | |
parent | 71c4c2a898a827a867564159ce78e41aedd2295b (diff) |
Merge "Introduce new API for retrieving PNO scan results" into oc-mr1-dev
Diffstat (limited to 'tests')
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/WificondControlTest.java | 12 | ||||
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/scanner/WificondPnoScannerTest.java | 3 |
2 files changed, 11 insertions, 4 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/WificondControlTest.java b/tests/wifitests/src/com/android/server/wifi/WificondControlTest.java index 4dfa4cd75..164f75999 100644 --- a/tests/wifitests/src/com/android/server/wifi/WificondControlTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WificondControlTest.java @@ -460,7 +460,8 @@ public class WificondControlTest { assertTrue(mWificondControl.tearDownInterfaces()); // getScanResults should fail. - assertEquals(0, mWificondControl.getScanResults().size()); + assertEquals(0, + mWificondControl.getScanResults(WificondControl.SCAN_TYPE_SINGLE_SCAN).size()); } /** @@ -475,7 +476,8 @@ public class WificondControlTest { NativeScanResult[] mockScanResults = {MOCK_NATIVE_SCAN_RESULT}; when(scanner.getScanResults()).thenReturn(mockScanResults); - ArrayList<ScanDetail> returnedScanResults = mWificondControl.getScanResults(); + ArrayList<ScanDetail> returnedScanResults = mWificondControl.getScanResults( + WificondControl.SCAN_TYPE_SINGLE_SCAN); // The test IEs {@link #TEST_INFO_ELEMENT} doesn't contained RSN IE, which means non-EAP // AP. So verify carrier network is not checked, since EAP is currently required for a // carrier network. @@ -522,7 +524,8 @@ public class WificondControlTest { .thenReturn(eapType); when(mCarrierNetworkConfig.getCarrierName(new String(nativeScanResult.ssid))) .thenReturn(carrierName); - ArrayList<ScanDetail> returnedScanResults = mWificondControl.getScanResults(); + ArrayList<ScanDetail> returnedScanResults = mWificondControl.getScanResults( + WificondControl.SCAN_TYPE_SINGLE_SCAN); assertEquals(1, returnedScanResults.size()); // Verify returned scan result. ScanResult scanResult = returnedScanResults.get(0).getScanResult(); @@ -535,7 +538,8 @@ public class WificondControlTest { // AP not associated with a carrier network. when(mCarrierNetworkConfig.isCarrierNetwork(new String(nativeScanResult.ssid))) .thenReturn(false); - returnedScanResults = mWificondControl.getScanResults(); + returnedScanResults = mWificondControl.getScanResults( + WificondControl.SCAN_TYPE_SINGLE_SCAN); assertEquals(1, returnedScanResults.size()); // Verify returned scan result. scanResult = returnedScanResults.get(0).getScanResult(); diff --git a/tests/wifitests/src/com/android/server/wifi/scanner/WificondPnoScannerTest.java b/tests/wifitests/src/com/android/server/wifi/scanner/WificondPnoScannerTest.java index c63a9a042..974cf6635 100644 --- a/tests/wifitests/src/com/android/server/wifi/scanner/WificondPnoScannerTest.java +++ b/tests/wifitests/src/com/android/server/wifi/scanner/WificondPnoScannerTest.java @@ -429,6 +429,7 @@ public class WificondPnoScannerTest { expectHwDisconnectedPnoScanStart(order, pnoSettings); // Setup scan results + when(mWifiNative.getPnoScanResults()).thenReturn(scanResults.getScanDetailArrayList()); when(mWifiNative.getScanResults()).thenReturn(scanResults.getScanDetailArrayList()); // Notify scan has finished @@ -451,6 +452,7 @@ public class WificondPnoScannerTest { order.verify(mWifiNative).scan(eq(expectedScanFreqs), any(Set.class)); + when(mWifiNative.getPnoScanResults()).thenReturn(scanResults.getScanDetailArrayList()); when(mWifiNative.getScanResults()).thenReturn(scanResults.getScanDetailArrayList()); // Notify scan has finished @@ -478,6 +480,7 @@ public class WificondPnoScannerTest { // Setup scan results when(mWifiNative.getScanResults()).thenReturn(scanResults.getScanDetailArrayList()); + when(mWifiNative.getPnoScanResults()).thenReturn(scanResults.getScanDetailArrayList()); // Notify scan has finished mWifiMonitor.sendMessage(mWifiNative.getInterfaceName(), WifiMonitor.SCAN_RESULTS_EVENT); |