summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEtan Cohen <etancohen@google.com>2019-12-10 02:46:36 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2019-12-10 02:46:36 +0000
commitfcd87af28d921bba79f2a0c4e818945682fb772c (patch)
tree91fe2ddbc5ce308eedf347435e9f057cd8381229 /tests
parent77236e5278abc5167da85b334f1e9e84fb09652a (diff)
parentd41ee729484c8cf82acd7bf58d7c3fd2f01afc22 (diff)
Merge changes from topic "wificond_phase2"
* changes: [WIFI][MAINLINE] Transition WificondControl interfaces: DeathListner -> Runnable [WIFI][MAINLINE] Transition WificondControl interfaces: PnoSettings
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiNativeInterfaceManagementTest.java7
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiNativeTest.java2
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WificondControlTest.java20
3 files changed, 14 insertions, 15 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiNativeInterfaceManagementTest.java b/tests/wifitests/src/com/android/server/wifi/WifiNativeInterfaceManagementTest.java
index 648faa55a..1a56504e1 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiNativeInterfaceManagementTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiNativeInterfaceManagementTest.java
@@ -52,7 +52,6 @@ import com.android.server.net.BaseNetworkObserver;
import com.android.server.wifi.HalDeviceManager.InterfaceDestroyedListener;
import com.android.server.wifi.WifiNative.SupplicantDeathEventHandler;
import com.android.server.wifi.WifiNative.VendorHalDeathEventHandler;
-import com.android.server.wifi.WifiNative.WificondDeathEventHandler;
import org.junit.After;
import org.junit.Before;
@@ -91,8 +90,8 @@ public class WifiNativeInterfaceManagementTest extends WifiBaseTest {
private ArgumentCaptor<VendorHalDeathEventHandler> mWifiVendorHalDeathHandlerCaptor =
ArgumentCaptor.forClass(VendorHalDeathEventHandler.class);
- private ArgumentCaptor<WificondDeathEventHandler> mWificondDeathHandlerCaptor =
- ArgumentCaptor.forClass(WificondDeathEventHandler.class);
+ private ArgumentCaptor<Runnable> mWificondDeathHandlerCaptor =
+ ArgumentCaptor.forClass(Runnable.class);
private ArgumentCaptor<WifiNative.VendorHalRadioModeChangeEventHandler>
mWifiVendorHalRadioModeChangeHandlerCaptor =
ArgumentCaptor.forClass(WifiNative.VendorHalRadioModeChangeEventHandler.class);
@@ -742,7 +741,7 @@ public class WifiNativeInterfaceManagementTest extends WifiBaseTest {
false, false, IFACE_NAME_0, mIfaceCallback0, mIfaceDestroyedListenerCaptor0,
mNetworkObserverCaptor0);
// Trigger wificond death
- mWificondDeathHandlerCaptor.getValue().onDeath();
+ mWificondDeathHandlerCaptor.getValue().run();
mInOrder.verify(mWifiMetrics).incrementNumWificondCrashes();
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiNativeTest.java b/tests/wifitests/src/com/android/server/wifi/WifiNativeTest.java
index c13a5fc90..73969d7a6 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiNativeTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiNativeTest.java
@@ -558,7 +558,7 @@ public class WifiNativeTest extends WifiBaseTest {
public void testStartPnoScan() throws Exception {
mWifiNative.startPnoScan(WIFI_IFACE_NAME, TEST_PNO_SETTINGS);
verify(mWificondControl).startPnoScan(
- WIFI_IFACE_NAME, TEST_PNO_SETTINGS);
+ WIFI_IFACE_NAME, TEST_PNO_SETTINGS.toNativePnoSettings());
}
/**
diff --git a/tests/wifitests/src/com/android/server/wifi/WificondControlTest.java b/tests/wifitests/src/com/android/server/wifi/WificondControlTest.java
index 5a0d91488..722c86842 100644
--- a/tests/wifitests/src/com/android/server/wifi/WificondControlTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WificondControlTest.java
@@ -796,7 +796,8 @@ public class WificondControlTest extends WifiBaseTest {
@Test
public void testStartPnoScan() throws Exception {
when(mWifiScannerImpl.startPnoScan(any(PnoSettings.class))).thenReturn(true);
- assertTrue(mWificondControl.startPnoScan(TEST_INTERFACE_NAME, TEST_PNO_SETTINGS));
+ assertTrue(mWificondControl.startPnoScan(TEST_INTERFACE_NAME,
+ TEST_PNO_SETTINGS.toNativePnoSettings()));
verify(mWifiScannerImpl).startPnoScan(argThat(new PnoScanMatcher(TEST_PNO_SETTINGS)));
}
@@ -889,7 +890,8 @@ public class WificondControlTest extends WifiBaseTest {
@Test
public void testStartPnoScanForMetrics() throws Exception {
when(mWifiScannerImpl.startPnoScan(any(PnoSettings.class))).thenReturn(false);
- assertFalse(mWificondControl.startPnoScan(TEST_INTERFACE_NAME, TEST_PNO_SETTINGS));
+ assertFalse(mWificondControl.startPnoScan(TEST_INTERFACE_NAME,
+ TEST_PNO_SETTINGS.toNativePnoSettings()));
verify(mWifiMetrics).incrementPnoScanStartAttempCount();
verify(mWifiMetrics).incrementPnoScanFailedCount();
}
@@ -939,13 +941,12 @@ public class WificondControlTest extends WifiBaseTest {
*/
@Test
public void testRegisterDeathHandler() throws Exception {
- WifiNative.WificondDeathEventHandler handler =
- mock(WifiNative.WificondDeathEventHandler.class);
- assertTrue(mWificondControl.initialize(handler));
+ Runnable deathHandler = mock(Runnable.class);
+ assertTrue(mWificondControl.initialize(deathHandler));
verify(mWificond).tearDownInterfaces();
mWificondControl.binderDied();
mLooper.dispatchAll();
- verify(handler).onDeath();
+ verify(deathHandler).run();
}
/**
@@ -954,15 +955,14 @@ public class WificondControlTest extends WifiBaseTest {
*/
@Test
public void testDeathHandling() throws Exception {
- WifiNative.WificondDeathEventHandler handler =
- mock(WifiNative.WificondDeathEventHandler.class);
- assertTrue(mWificondControl.initialize(handler));
+ Runnable deathHandler = mock(Runnable.class);
+ assertTrue(mWificondControl.initialize(deathHandler));
testSetupInterfaceForClientMode();
mWificondControl.binderDied();
mLooper.dispatchAll();
- verify(handler).onDeath();
+ verify(deathHandler).run();
// The handles should be cleared after death.
assertNull(mWificondControl.getChannelsForBand(WifiScanner.WIFI_BAND_5_GHZ));