summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorTreeHugger Robot <treehugger-gerrit@google.com>2016-08-18 17:21:55 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2016-08-18 17:21:56 +0000
commitce98615677a3f99d8fec8826ea1e0f1eeedb0692 (patch)
tree4575f9750773460e7e01359c0536b57fa6749815 /tests
parent154d4e305ba742bcf6955881b77ff008ee550969 (diff)
parent8249dec7f00e21218bcff6e16cf584ef37d87686 (diff)
Merge "Rely on wificond to start/stop supplicant"
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java17
1 files changed, 4 insertions, 13 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java b/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java
index 0e2581d24..ac879f9b3 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java
@@ -383,6 +383,8 @@ public class WifiStateMachineTest {
when(mWificond.createClientInterface()).thenReturn(mClientInterface);
when(mClientInterface.asBinder()).thenReturn(mClientInterfaceBinder);
+ when(mClientInterface.enableSupplicant()).thenReturn(true);
+ when(mClientInterface.disableSupplicant()).thenReturn(true);
mWsm = new WifiStateMachine(context, factory, mLooper.getLooper(),
mUserManager, mWifiInjector, mBackupManagerProxy, mCountryCode);
@@ -441,7 +443,6 @@ public class WifiStateMachineTest {
@Test
public void loadComponents() throws Exception {
when(mWifiNative.startHal()).thenReturn(true);
- when(mWifiNative.startSupplicant()).thenReturn(true);
mWsm.setSupplicantRunning(true);
mLooper.dispatchAll();
@@ -465,16 +466,8 @@ public class WifiStateMachineTest {
}
@Test
- public void shouldRequireHalToLeaveInitialState() throws Exception {
- when(mWifiNative.startHal()).thenReturn(false);
- mWsm.setSupplicantRunning(true);
- mLooper.dispatchAll();
- assertEquals("InitialState", getCurrentState().getName());
- }
-
- @Test
public void shouldRequireSupplicantStartupToLeaveInitialState() throws Exception {
- when(mWifiNative.startSupplicant()).thenReturn(false);
+ when(mClientInterface.enableSupplicant()).thenReturn(false);
mWsm.setSupplicantRunning(true);
mLooper.dispatchAll();
assertEquals("InitialState", getCurrentState().getName());
@@ -507,7 +500,7 @@ public class WifiStateMachineTest {
@Test
public void loadComponentsFailure() throws Exception {
when(mWifiNative.startHal()).thenReturn(false);
- when(mWifiNative.startSupplicant()).thenReturn(false);
+ when(mClientInterface.enableSupplicant()).thenReturn(false);
mWsm.setSupplicantRunning(true);
mLooper.dispatchAll();
@@ -534,7 +527,6 @@ public class WifiStateMachineTest {
@Test
public void shouldStartSupplicantWhenConnectModeRequested() throws Exception {
when(mWifiNative.startHal()).thenReturn(true);
- when(mWifiNative.startSupplicant()).thenReturn(true);
// The first time we start out in InitialState, we sit around here.
mLooper.dispatchAll();
@@ -554,7 +546,6 @@ public class WifiStateMachineTest {
@Test
public void checkStartInCorrectStateAfterChangingInitialState() throws Exception {
when(mWifiNative.startHal()).thenReturn(true);
- when(mWifiNative.startSupplicant()).thenReturn(true);
// Check initial state
mLooper.dispatchAll();