summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRebecca Silberstein <silberst@google.com>2018-06-27 16:35:57 -0700
committerMichael Plass <mplass@google.com>2018-07-03 10:47:03 -0700
commit2b0f742024b40e59c791b7b9831cc078672d2722 (patch)
tree0ee8171b14c3afdc29c3c7f12108d356189d064b /tests
parentd5c6cd7fae3384f351b51f129d6820e84ca9ba16 (diff)
WifiController: merge client mode related states
With the refactor, we can simplify the state machine in WifiController by merging DeviceActiveState into StaEnabledState. Bug: 79209870 Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh Test: verified recovery path still working after killing supplicant Change-Id: I0f4af6a68cbafba63dadc820c0e986e32f5e9846
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/WifiControllerTest.java34
1 files changed, 17 insertions, 17 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiControllerTest.java b/tests/wifitests/src/com/android/server/wifi/WifiControllerTest.java
index 31786c8e7..3fe40801b 100644
--- a/tests/wifitests/src/com/android/server/wifi/WifiControllerTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/WifiControllerTest.java
@@ -145,7 +145,7 @@ public class WifiControllerTest {
when(mSettingsStore.isWifiToggleEnabled()).thenReturn(true);
mWifiController.sendMessage(CMD_WIFI_TOGGLED);
mLooper.dispatchAll();
- assertEquals("DeviceActiveState", getCurrentState().getName());
+ assertEquals("StaEnabledState", getCurrentState().getName());
}
/**
@@ -753,15 +753,15 @@ public class WifiControllerTest {
/**
* When AP mode is enabled and wifi was previously in AP mode, we should return to
- * DeviceActiveState after the AP is disabled.
- * Enter DeviceActiveState, activate AP mode, disable AP mode.
+ * StaEnabledState after the AP is disabled.
+ * Enter StaEnabledState, activate AP mode, disable AP mode.
* <p>
- * Expected: AP should successfully start and exit, then return to DeviceActiveState.
+ * Expected: AP should successfully start and exit, then return to StaEnabledState.
*/
@Test
- public void testReturnToDeviceActiveStateAfterAPModeShutdown() throws Exception {
+ public void testReturnToStaEnabledStateAfterAPModeShutdown() throws Exception {
enableWifi();
- assertEquals("DeviceActiveState", getCurrentState().getName());
+ assertEquals("StaEnabledState", getCurrentState().getName());
mWifiController.obtainMessage(CMD_SET_AP, 1, 0).sendToTarget();
// add an "unexpected" sta mode stop to simulate a single interface device
@@ -774,20 +774,20 @@ public class WifiControllerTest {
InOrder inOrder = inOrder(mActiveModeWarden);
inOrder.verify(mActiveModeWarden).enterClientMode();
- assertEquals("DeviceActiveState", getCurrentState().getName());
+ assertEquals("StaEnabledState", getCurrentState().getName());
}
/**
* When AP mode is enabled and wifi is toggled on, we should transition to
- * DeviceActiveState after the AP is disabled.
- * Enter DeviceActiveState, activate AP mode, toggle WiFi.
+ * StaEnabledState after the AP is disabled.
+ * Enter StaEnabledState, activate AP mode, toggle WiFi.
* <p>
- * Expected: AP should successfully start and exit, then return to DeviceActiveState.
+ * Expected: AP should successfully start and exit, then return to StaEnabledState.
*/
@Test
- public void testReturnToDeviceActiveStateAfterWifiEnabledShutdown() throws Exception {
+ public void testReturnToStaEnabledStateAfterWifiEnabledShutdown() throws Exception {
enableWifi();
- assertEquals("DeviceActiveState", getCurrentState().getName());
+ assertEquals("StaEnabledState", getCurrentState().getName());
mWifiController.obtainMessage(CMD_SET_AP, 1, 0).sendToTarget();
mLooper.dispatchAll();
@@ -799,7 +799,7 @@ public class WifiControllerTest {
InOrder inOrder = inOrder(mActiveModeWarden);
inOrder.verify(mActiveModeWarden).enterClientMode();
- assertEquals("DeviceActiveState", getCurrentState().getName());
+ assertEquals("StaEnabledState", getCurrentState().getName());
}
@Test
@@ -904,7 +904,7 @@ public class WifiControllerTest {
* the ActiveModeWarden.shutdownWifi() call when in STA mode.
* WiFi is in connect mode, calls to reset the wifi stack due to connection failures
* should trigger a supplicant stop, and subsequently, a driver reload.
- * Create and start WifiController in DeviceActiveState, send command to restart WiFi
+ * Create and start WifiController in StaEnabledState, send command to restart WiFi
* <p>
* Expected: WiFiController should call ActiveModeWarden.shutdownWifi() and
* ActiveModeWarden should enter CONNECT_MODE and the wifi driver should be started.
@@ -912,14 +912,14 @@ public class WifiControllerTest {
@Test
public void testRestartWifiStackInStaEnabledState() throws Exception {
enableWifi();
- assertEquals("DeviceActiveState", getCurrentState().getName());
+ assertEquals("StaEnabledState", getCurrentState().getName());
mWifiController.sendMessage(CMD_RECOVERY_RESTART_WIFI);
mLooper.dispatchAll();
InOrder inOrder = inOrder(mActiveModeWarden);
inOrder.verify(mActiveModeWarden).shutdownWifi();
inOrder.verify(mActiveModeWarden).enterClientMode();
- assertEquals("DeviceActiveState", getCurrentState().getName());
+ assertEquals("StaEnabledState", getCurrentState().getName());
}
/**
@@ -932,7 +932,7 @@ public class WifiControllerTest {
@Test
public void testRestartWifiStackDoesNotExitECMMode() throws Exception {
enableWifi();
- assertEquals("DeviceActiveState", getCurrentState().getName());
+ assertEquals("StaEnabledState", getCurrentState().getName());
when(mFacade.getConfigWiFiDisableInECBM(mContext)).thenReturn(true);
mWifiController.sendMessage(CMD_EMERGENCY_CALL_STATE_CHANGED, 1);