diff options
author | Rebecca Silberstein <silberst@google.com> | 2018-03-03 22:56:23 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2018-03-03 22:56:23 +0000 |
commit | 34226fdc35f33a5c3a95e0b86138c933c5682370 (patch) | |
tree | 4dd8e4d436df08d8772b1db4ad5331d41ec5b2d6 /tests | |
parent | cfeb6aef73506177bf574cb00850de374ea48d26 (diff) | |
parent | ec3757ce8a65c810f2f887eeb6e99b501bdd6ae3 (diff) |
Merge "SoftApManager: handle interface down"
Diffstat (limited to 'tests')
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/SoftApManagerTest.java | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/SoftApManagerTest.java b/tests/wifitests/src/com/android/server/wifi/SoftApManagerTest.java index ab2fc793c..9a0e39999 100644 --- a/tests/wifitests/src/com/android/server/wifi/SoftApManagerTest.java +++ b/tests/wifitests/src/com/android/server/wifi/SoftApManagerTest.java @@ -587,8 +587,22 @@ public class SoftApManagerTest { mLooper.dispatchAll(); - // this will need updating when onDown properly triggers stop and failure reporting - verifyNoMoreInteractions(mContext, mCallback, mWifiNative); + order.verify(mCallback).onStateChanged(WifiManager.WIFI_AP_STATE_FAILED, + WifiManager.SAP_START_FAILURE_GENERAL); + ArgumentCaptor<Intent> intentCaptor = ArgumentCaptor.forClass(Intent.class); + verify(mContext, times(3)).sendStickyBroadcastAsUser(intentCaptor.capture(), + eq(UserHandle.ALL)); + + List<Intent> capturedIntents = intentCaptor.getAllValues(); + checkApStateChangedBroadcast(capturedIntents.get(0), WIFI_AP_STATE_FAILED, + WIFI_AP_STATE_ENABLED, WifiManager.SAP_START_FAILURE_GENERAL, TEST_INTERFACE_NAME, + softApModeConfig.getTargetMode()); + checkApStateChangedBroadcast(capturedIntents.get(1), WIFI_AP_STATE_DISABLING, + WIFI_AP_STATE_FAILED, HOTSPOT_NO_ERROR, TEST_INTERFACE_NAME, + softApModeConfig.getTargetMode()); + checkApStateChangedBroadcast(capturedIntents.get(2), WIFI_AP_STATE_DISABLED, + WIFI_AP_STATE_DISABLING, HOTSPOT_NO_ERROR, TEST_INTERFACE_NAME, + softApModeConfig.getTargetMode()); } /** |