summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiNativeTest.java21
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java4
2 files changed, 15 insertions, 10 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiNativeTest.java b/tests/wifitests/src/com/android/server/wifi/WifiNativeTest.java
index ef33b656f..a9a32bd40 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiNativeTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiNativeTest.java
@@ -20,6 +20,7 @@ import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
+import static org.mockito.Mockito.anyBoolean;
import static org.mockito.Mockito.anyInt;
import static org.mockito.Mockito.anyString;
import static org.mockito.Mockito.eq;
@@ -157,6 +158,7 @@ public class WifiNativeTest {
wifiNativeConstructor.setAccessible(true);
mWifiNative = spy(wifiNativeConstructor.newInstance("test", true));
mWifiVendorHal = mock(WifiVendorHal.class);
+ when(mWifiVendorHal.startVendorHal(anyBoolean())).thenReturn(true);
mWifiNative.setWifiVendorHal(mWifiVendorHal);
}
@@ -517,10 +519,10 @@ public class WifiNativeTest {
when(wificondControl.setupDriverForClientMode()).thenReturn(clientInterface);
mWifiNative.setWificondControl(wificondControl);
- IClientInterface returnedClientInterface = mWifiNative.setupDriverForClientMode();
+ IClientInterface returnedClientInterface = mWifiNative.setupForClientMode();
assertEquals(clientInterface, returnedClientInterface);
- verify(wificondControl).setupDriverForClientMode();
verify(mWifiNative).startHal(eq(true));
+ verify(wificondControl).setupDriverForClientMode();
}
/**
@@ -535,8 +537,9 @@ public class WifiNativeTest {
when(wificondControl.setupDriverForClientMode()).thenReturn(null);
mWifiNative.setWificondControl(wificondControl);
- IClientInterface returnedClientInterface = mWifiNative.setupDriverForClientMode();
+ IClientInterface returnedClientInterface = mWifiNative.setupForClientMode();
assertEquals(null, returnedClientInterface);
+ verify(mWifiNative).startHal(eq(true));
verify(wificondControl).setupDriverForClientMode();
}
@@ -552,10 +555,10 @@ public class WifiNativeTest {
when(wificondControl.setupDriverForSoftApMode()).thenReturn(apInterface);
mWifiNative.setWificondControl(wificondControl);
- IApInterface returnedApInterface = mWifiNative.setupDriverForSoftApMode();
+ IApInterface returnedApInterface = mWifiNative.setupForSoftApMode();
assertEquals(apInterface, returnedApInterface);
- verify(wificondControl).setupDriverForSoftApMode();
verify(mWifiNative).startHal(eq(false));
+ verify(wificondControl).setupDriverForSoftApMode();
}
/**
@@ -570,8 +573,9 @@ public class WifiNativeTest {
when(wificondControl.setupDriverForSoftApMode()).thenReturn(null);
mWifiNative.setWificondControl(wificondControl);
- IApInterface returnedApInterface = mWifiNative.setupDriverForSoftApMode();
+ IApInterface returnedApInterface = mWifiNative.setupForSoftApMode();
assertEquals(null, returnedApInterface);
+ verify(mWifiNative).startHal(eq(false));
verify(wificondControl).setupDriverForSoftApMode();
}
@@ -607,14 +611,15 @@ public class WifiNativeTest {
* Verifies that tearDownInterfaces() calls underlying WificondControl.
*/
@Test
- public void testTearDownInterfaces() {
+ public void testTearDown() {
WificondControl wificondControl = mock(WificondControl.class);
when(wificondControl.tearDownInterfaces()).thenReturn(true);
mWifiNative.setWificondControl(wificondControl);
- assertTrue(mWifiNative.tearDownInterfaces());
+ assertTrue(mWifiNative.tearDown());
verify(wificondControl).tearDownInterfaces();
+ verify(mWifiVendorHal).stopVendorHal();
}
/**
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java b/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java
index 45874ac80..9ab24c56b 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java
@@ -367,8 +367,8 @@ public class WifiStateMachineTest {
.thenReturn(mSoftApManager);
when(mWifiInjector.getPasspointManager()).thenReturn(mPasspointManager);
- when(mWifiNative.setupDriverForClientMode()).thenReturn(mClientInterface);
- when(mWifiNative.setupDriverForSoftApMode()).thenReturn(mApInterface);
+ when(mWifiNative.setupForClientMode()).thenReturn(mClientInterface);
+ when(mWifiNative.setupForSoftApMode()).thenReturn(mApInterface);
when(mWifiInjector.getWifiStateTracker()).thenReturn(mWifiStateTracker);
when(mWifiNative.getInterfaceName()).thenReturn("mockWlan");
when(mWifiNative.enableSupplicant()).thenReturn(true);