diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java b/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java index 80e29c6b1..e1a88915b 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java @@ -1304,18 +1304,16 @@ public class WifiStateMachineTest { wpsInfo.setup = WpsInfo.PBC; wpsInfo.BSSID = sBSSID; - mLooper.startAutoDispatch(); mWsm.sendMessage(WifiManager.START_WPS, 0, 0, wpsInfo); - mLooper.stopAutoDispatch(); + mLooper.dispatchAll(); verify(mWifiNative).startWpsPbc(eq(sBSSID)); assertEquals("WpsRunningState", getCurrentState().getName()); setupMocksForWpsNetworkMigration(); - mLooper.startAutoDispatch(); mWsm.sendMessage(WifiMonitor.NETWORK_CONNECTION_EVENT, 0, 0, null); - mLooper.stopAutoDispatch(); + mLooper.dispatchAll(); assertEquals("DisconnectedState", getCurrentState().getName()); } @@ -1334,9 +1332,8 @@ public class WifiStateMachineTest { wpsInfo.setup = WpsInfo.PBC; wpsInfo.BSSID = sBSSID; - mLooper.startAutoDispatch(); mWsm.sendMessage(WifiManager.START_WPS, 0, 0, wpsInfo); - mLooper.stopAutoDispatch(); + mLooper.dispatchAll(); verify(mWifiNative).startWpsPbc(eq(sBSSID)); assertFalse("WpsRunningState".equals(getCurrentState().getName())); @@ -1356,18 +1353,16 @@ public class WifiStateMachineTest { wpsInfo.setup = WpsInfo.DISPLAY; wpsInfo.BSSID = sBSSID; - mLooper.startAutoDispatch(); mWsm.sendMessage(WifiManager.START_WPS, 0, 0, wpsInfo); - mLooper.stopAutoDispatch(); + mLooper.dispatchAll(); verify(mWifiNative).startWpsPinDisplay(eq(sBSSID)); assertEquals("WpsRunningState", getCurrentState().getName()); setupMocksForWpsNetworkMigration(); - mLooper.startAutoDispatch(); mWsm.sendMessage(WifiMonitor.NETWORK_CONNECTION_EVENT, 0, 0, null); - mLooper.stopAutoDispatch(); + mLooper.dispatchAll(); assertEquals("DisconnectedState", getCurrentState().getName()); } @@ -1386,9 +1381,8 @@ public class WifiStateMachineTest { wpsInfo.setup = WpsInfo.DISPLAY; wpsInfo.BSSID = sBSSID; - mLooper.startAutoDispatch(); mWsm.sendMessage(WifiManager.START_WPS, 0, 0, wpsInfo); - mLooper.stopAutoDispatch(); + mLooper.dispatchAll(); verify(mWifiNative).startWpsPinDisplay(eq(sBSSID)); assertFalse("WpsRunningState".equals(getCurrentState().getName())); @@ -1415,9 +1409,8 @@ public class WifiStateMachineTest { assertFalse("InitialState".equals(getCurrentState().getName())); // Now trigger the death notification. - mLooper.startAutoDispatch(); deathHandler.onDeath(); - mLooper.stopAutoDispatch(); + mLooper.dispatchAll(); // We should back to initial state after vendor HAL death. assertTrue("InitialState".equals(getCurrentState().getName())); |