diff options
author | Rebecca Silberstein <silberst@google.com> | 2018-05-23 17:43:45 -0700 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2018-05-23 17:43:45 -0700 |
commit | 18f97012d0e5a63353535051239327c6bd608168 (patch) | |
tree | eefe65f75a96d6b758ffccbc6995c604b955b818 /tests | |
parent | 684020b48b6075493fccefb9d22bc2f19ecec5db (diff) | |
parent | 8b8c239ae1190a8055b378cfdb503df9823dba16 (diff) |
Merge changes I790baf5e,I133f4861 into pi-dev
am: 8b8c239ae1
Change-Id: I7d4a78e3b1ff25a5efbf88aa0f4d05be4129926d
Diffstat (limited to 'tests')
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/ClientModeManagerTest.java | 12 | ||||
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/ScanOnlyModeManagerTest.java | 8 |
2 files changed, 6 insertions, 14 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/ClientModeManagerTest.java b/tests/wifitests/src/com/android/server/wifi/ClientModeManagerTest.java index b04caf54d..ca6ddfd61 100644 --- a/tests/wifitests/src/com/android/server/wifi/ClientModeManagerTest.java +++ b/tests/wifitests/src/com/android/server/wifi/ClientModeManagerTest.java @@ -158,7 +158,7 @@ public class ClientModeManagerTest { assertEquals(2, intents.size()); checkWifiStateChangedBroadcast(intents.get(0), WIFI_STATE_DISABLING, WIFI_STATE_UNKNOWN); checkWifiStateChangedBroadcast(intents.get(1), WIFI_STATE_DISABLED, WIFI_STATE_DISABLING); - checkWifiStateChangeListenerUpdate(WIFI_STATE_DISABLED); + checkWifiStateChangeListenerUpdate(WIFI_STATE_UNKNOWN); } /** @@ -227,11 +227,14 @@ public class ClientModeManagerTest { @Test public void clientModeStopCleansUpState() throws Exception { startClientModeAndVerifyEnabled(); - reset(mContext); + reset(mContext, mListener); mClientModeManager.stop(); mLooper.dispatchAll(); verifyNotificationsForCleanShutdown(WIFI_STATE_ENABLED); + + // on an explicit stop, we should not trigger the callback + verifyNoMoreInteractions(mListener); } /** @@ -309,11 +312,6 @@ public class ClientModeManagerTest { mClientModeManager.stop(); mLooper.dispatchAll(); - verify(mListener).onStateChanged(WIFI_STATE_DISABLING); - verify(mListener).onStateChanged(WIFI_STATE_DISABLED); - - reset(mListener); - // now trigger interface destroyed and make sure callback doesn't get called mInterfaceCallbackCaptor.getValue().onDestroyed(TEST_INTERFACE_NAME); mLooper.dispatchAll(); diff --git a/tests/wifitests/src/com/android/server/wifi/ScanOnlyModeManagerTest.java b/tests/wifitests/src/com/android/server/wifi/ScanOnlyModeManagerTest.java index 3ad57f535..41362eec6 100644 --- a/tests/wifitests/src/com/android/server/wifi/ScanOnlyModeManagerTest.java +++ b/tests/wifitests/src/com/android/server/wifi/ScanOnlyModeManagerTest.java @@ -170,7 +170,7 @@ public class ScanOnlyModeManagerTest { mLooper.dispatchAll(); verify(mWifiNative).teardownInterface(TEST_INTERFACE_NAME); verify(mContext, never()).sendStickyBroadcastAsUser(any(), eq(UserHandle.ALL)); - checkWifiStateChangeListenerUpdate(WIFI_STATE_DISABLED); + verifyNoMoreInteractions(mListener); } /** @@ -214,7 +214,6 @@ public class ScanOnlyModeManagerTest { mLooper.dispatchAll(); verify(mContext, never()).sendStickyBroadcastAsUser(any(), eq(UserHandle.ALL)); checkWifiStateChangeListenerUpdate(WIFI_STATE_UNKNOWN); - checkWifiStateChangeListenerUpdate(WIFI_STATE_DISABLED); verify(mScanRequestProxy).clearScanResults(); } @@ -246,10 +245,6 @@ public class ScanOnlyModeManagerTest { mScanOnlyModeManager.stop(); mLooper.dispatchAll(); - verify(mListener).onStateChanged(WIFI_STATE_DISABLED); - - reset(mListener); - // now trigger interface destroyed and make sure callback doesn't get called mInterfaceCallbackCaptor.getValue().onDestroyed(TEST_INTERFACE_NAME); mLooper.dispatchAll(); @@ -282,6 +277,5 @@ public class ScanOnlyModeManagerTest { inOrder.verify(mWakeupController).start(); inOrder.verify(mWakeupController).stop(); inOrder.verify(mWifiNative).teardownInterface(eq(TEST_INTERFACE_NAME)); - inOrder.verify(mListener).onStateChanged(eq(WIFI_STATE_DISABLED)); } } |