From ae6cc3065f240990b9600ca802af4f98b2df96cd Mon Sep 17 00:00:00 2001 From: Rebecca Silberstein Date: Mon, 14 Aug 2017 16:52:02 -0700 Subject: WifiStateMachineTest: remove looper race Two WifiStateMachineTest tests had a slight race when sending extra messages to WSM after setting up the test condition. This CL removes the extra mode message + internal state check. Bug: 37358048 Test: frameworks/opt/net/wifi/tests/wifitests/runtests.sh Change-Id: I71356679d67ae2aafd68372ee75eff24af29eaf7 --- .../src/com/android/server/wifi/WifiStateMachineTest.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'tests') diff --git a/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java b/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java index 5d5a5a6aa..be5892196 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiStateMachineTest.java @@ -2001,9 +2001,7 @@ public class WifiStateMachineTest { @Test public void testStartWps_nullWpsInfo() throws Exception { loadComponentsInStaMode(); - mWsm.setOperationalMode(WifiStateMachine.CONNECT_MODE); - assertEquals(WifiStateMachine.CONNECT_MODE, mWsm.getOperationalModeForTest()); - assertEquals("DisconnectedState", getCurrentState().getName()); + mLooper.startAutoDispatch(); Message reply = mWsmAsyncChannel.sendMessageSynchronously(WifiManager.START_WPS, 0, 0, null); @@ -2018,9 +2016,6 @@ public class WifiStateMachineTest { @Test public void testSyncDisableNetwork_failure() throws Exception { loadComponentsInStaMode(); - mWsm.setOperationalMode(WifiStateMachine.CONNECT_MODE); - assertEquals(WifiStateMachine.CONNECT_MODE, mWsm.getOperationalModeForTest()); - assertEquals("DisconnectedState", getCurrentState().getName()); when(mWifiConfigManager.disableNetwork(anyInt(), anyInt())).thenReturn(false); mLooper.startAutoDispatch(); -- cgit v1.2.3