diff options
author | Ningyuan Wang <nywang@google.com> | 2017-03-23 18:20:22 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-03-23 18:20:22 +0000 |
commit | 1294ec27c04b8efffcd1d38056dfa7368eae39a4 (patch) | |
tree | 00e663cf35e5619aed824919330262d134c28a38 /tests | |
parent | 5ba387648378cb12f0dcfa057094cc8d99a79397 (diff) | |
parent | b68f68e3bc4b236a287ac5f502fbff996c60af3d (diff) |
Merge "Separate single scan and sched scan result handling" am: 7a74c36073 am: f0f96d5741
am: b68f68e3bc
Change-Id: I43fe1b256d1d35d4c7c7043d47f8927f3b6da517
Diffstat (limited to 'tests')
3 files changed, 18 insertions, 2 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiMonitorTest.java b/tests/wifitests/src/com/android/server/wifi/WifiMonitorTest.java index e9424223d..6e3dbbbcf 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiMonitorTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiMonitorTest.java @@ -291,6 +291,21 @@ public class WifiMonitorTest { } /** + * Broadcast pno scan results event test. + */ + @Test + public void testBroadcastPnoScanResultsEvent() { + mWifiMonitor.registerHandler( + WLAN_IFACE_NAME, WifiMonitor.PNO_SCAN_RESULTS_EVENT, mHandlerSpy); + mWifiMonitor.broadcastPnoScanResultEvent(WLAN_IFACE_NAME); + mLooper.dispatchAll(); + + ArgumentCaptor<Message> messageCaptor = ArgumentCaptor.forClass(Message.class); + verify(mHandlerSpy).handleMessage(messageCaptor.capture()); + assertEquals(WifiMonitor.PNO_SCAN_RESULTS_EVENT, messageCaptor.getValue().what); + } + + /** * Broadcast Scan results event test. */ @Test diff --git a/tests/wifitests/src/com/android/server/wifi/WificondControlTest.java b/tests/wifitests/src/com/android/server/wifi/WificondControlTest.java index 93ebd0b0c..8f2994141 100644 --- a/tests/wifitests/src/com/android/server/wifi/WificondControlTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WificondControlTest.java @@ -592,7 +592,7 @@ public class WificondControlTest { assertNotNull(pnoScanEvent); pnoScanEvent.OnPnoNetworkFound(); - verify(mWifiMonitor).broadcastScanResultEvent(any(String.class)); + verify(mWifiMonitor).broadcastPnoScanResultEvent(any(String.class)); } /** 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 1dd548153..24bcae296 100644 --- a/tests/wifitests/src/com/android/server/wifi/scanner/WificondPnoScannerTest.java +++ b/tests/wifitests/src/com/android/server/wifi/scanner/WificondPnoScannerTest.java @@ -432,7 +432,8 @@ public class WificondPnoScannerTest { when(mWifiNative.getScanResults()).thenReturn(scanResults.getScanDetailArrayList()); // Notify scan has finished - mWifiMonitor.sendMessage(mWifiNative.getInterfaceName(), WifiMonitor.SCAN_RESULTS_EVENT); + mWifiMonitor.sendMessage(mWifiNative.getInterfaceName(), + WifiMonitor.PNO_SCAN_RESULTS_EVENT); assertEquals("dispatch message after results event", 1, mLooper.dispatchAll()); order.verify(eventHandler).onPnoNetworkFound(scanResults.getRawScanResults()); |