summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorNingyuan Wang <nywang@google.com>2017-03-21 15:55:03 -0700
committerNingyuan Wang <nywang@google.com>2017-03-22 10:06:57 -0700
commit51493e199ebf1e1191ccf652f0081d229018a11f (patch)
treec6e9dcb6e4b1f35f3c58746470f4af5bcae01a2f /tests
parent168fba718720b54cf0a88cfad7f96948925fb1e3 (diff)
Separate single scan and sched scan result handling
Bug: 36479602 Test: compile, unit tests, integration test Change-Id: I066619ca7c53cf7e8e53ce776c1b419201d522f1
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiMonitorTest.java15
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WificondControlTest.java2
-rw-r--r--tests/wifitests/src/com/android/server/wifi/scanner/WificondPnoScannerTest.java3
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());