summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRebecca Silberstein <silberst@google.com>2017-03-23 18:48:24 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-03-23 18:48:24 +0000
commitf660ccc51029bb8fcd2f5e4fd54d078972b35b80 (patch)
treef99d92f404caa316a975b748e7e8fde07e3d8fc0 /tests
parent254c1858d2d13582b640c6893c5b1f51339d71bc (diff)
parent92f77d5ca967a31b64524212de932be8410b5b68 (diff)
Merge "SoftApManager: retrieve config when null" am: fb30401ec2 am: c9b0a3060a
am: 92f77d5ca9 Change-Id: Id8121a599e87309793b6b0a3a3374c90ae437219
Diffstat (limited to 'tests')
-rw-r--r--tests/wifitests/src/com/android/server/wifi/SoftApManagerTest.java24
1 files changed, 17 insertions, 7 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/SoftApManagerTest.java b/tests/wifitests/src/com/android/server/wifi/SoftApManagerTest.java
index 4420f87da..900e6a61a 100644
--- a/tests/wifitests/src/com/android/server/wifi/SoftApManagerTest.java
+++ b/tests/wifitests/src/com/android/server/wifi/SoftApManagerTest.java
@@ -106,6 +106,9 @@ public class SoftApManagerTest {
when(mApInterface.asBinder()).thenReturn(mApInterfaceBinder);
when(mApInterface.startHostapd()).thenReturn(true);
when(mApInterface.stopHostapd()).thenReturn(true);
+ if (config == null) {
+ when(mWifiApConfigStore.getApConfiguration()).thenReturn(mDefaultApConfig);
+ }
SoftApManager newSoftApManager = new SoftApManager(mLooper.getLooper(),
mWifiNative,
TEST_COUNTRY_CODE,
@@ -116,9 +119,6 @@ public class SoftApManagerTest {
config,
mWifiMetrics);
mLooper.dispatchAll();
- if (config != null) {
- verify(mWifiApConfigStore).setApConfiguration(config);
- }
return newSoftApManager;
}
@@ -140,10 +140,21 @@ public class SoftApManagerTest {
/** Tests softap startup if default config fails to load. **/
@Test
public void startSoftApDefaultConfigFailedToLoad() throws Exception {
- InOrder order = inOrder(mListener);
- mSoftApManager = createSoftApManager(null);
+ when(mApInterface.asBinder()).thenReturn(mApInterfaceBinder);
+ when(mApInterface.startHostapd()).thenReturn(true);
+ when(mApInterface.stopHostapd()).thenReturn(true);
when(mWifiApConfigStore.getApConfiguration()).thenReturn(null);
- mSoftApManager.start();
+ SoftApManager newSoftApManager = new SoftApManager(mLooper.getLooper(),
+ mWifiNative,
+ TEST_COUNTRY_CODE,
+ mListener,
+ mApInterface,
+ mNmService,
+ mWifiApConfigStore,
+ null,
+ mWifiMetrics);
+ mLooper.dispatchAll();
+ newSoftApManager.start();
mLooper.dispatchAll();
verify(mListener).onStateChanged(WifiManager.WIFI_AP_STATE_FAILED,
WifiManager.SAP_START_FAILURE_GENERAL);
@@ -200,7 +211,6 @@ public class SoftApManagerTest {
when(mWifiApConfigStore.getApConfiguration()).thenReturn(mDefaultApConfig);
expectedSSID = mDefaultApConfig.SSID;
} else {
- when(mWifiApConfigStore.getApConfiguration()).thenReturn(config);
expectedSSID = config.SSID;
}
mSoftApManager.start();