diff options
author | Rebecca Silberstein <silberst@google.com> | 2017-07-05 20:55:15 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2017-07-05 20:55:15 +0000 |
commit | cca4b57c80ceb087a0bd37fa2cbc0bcca483f3d0 (patch) | |
tree | d841742a0bd4a5905af79278d45a22c8605fec61 /tests | |
parent | 35eb2c8f6479eec50cf681c23f1a21a8ce14a691 (diff) | |
parent | 5c5b37f9cc52daff34b8509dbda68e754fbbcacb (diff) |
Merge "SoftApManager: support hidden ap configs" into oc-dr1-dev
Diffstat (limited to 'tests')
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/SoftApManagerTest.java | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/SoftApManagerTest.java b/tests/wifitests/src/com/android/server/wifi/SoftApManagerTest.java index 900e6a61a..892b5975c 100644 --- a/tests/wifitests/src/com/android/server/wifi/SoftApManagerTest.java +++ b/tests/wifitests/src/com/android/server/wifi/SoftApManagerTest.java @@ -137,6 +137,20 @@ public class SoftApManagerTest { startSoftApAndVerifyEnabled(config); } + + /** + * Verifies startSoftAp will start with the hiddenSSID param set when it is set to true in the + * supplied config. + */ + @Test + public void startSoftApWithHiddenSsidTrueInConfig() throws Exception { + WifiConfiguration config = new WifiConfiguration(); + config.apBand = WifiConfiguration.AP_BAND_2GHZ; + config.SSID = TEST_SSID; + config.hiddenSSID = true; + startSoftApAndVerifyEnabled(config); + } + /** Tests softap startup if default config fails to load. **/ @Test public void startSoftApDefaultConfigFailedToLoad() throws Exception { @@ -200,6 +214,7 @@ public class SoftApManagerTest { /** Starts soft AP and verifies that it is enabled successfully. */ protected void startSoftApAndVerifyEnabled(WifiConfiguration config) throws Exception { String expectedSSID; + boolean expectedHiddenSsid; InOrder order = inOrder(mListener, mApInterfaceBinder, mApInterface, mNmService); when(mWifiNative.isHalStarted()).thenReturn(false); @@ -210,16 +225,19 @@ public class SoftApManagerTest { if (config == null) { when(mWifiApConfigStore.getApConfiguration()).thenReturn(mDefaultApConfig); expectedSSID = mDefaultApConfig.SSID; + expectedHiddenSsid = mDefaultApConfig.hiddenSSID; } else { expectedSSID = config.SSID; + expectedHiddenSsid = config.hiddenSSID; } + mSoftApManager.start(); mLooper.dispatchAll(); order.verify(mListener).onStateChanged(WifiManager.WIFI_AP_STATE_ENABLING, 0); order.verify(mApInterfaceBinder).linkToDeath(mDeathListenerCaptor.capture(), eq(0)); order.verify(mNmService).registerObserver(mNetworkObserverCaptor.capture()); order.verify(mApInterface).writeHostapdConfig( - eq(expectedSSID.getBytes(StandardCharsets.UTF_8)), anyBoolean(), + eq(expectedSSID.getBytes(StandardCharsets.UTF_8)), eq(expectedHiddenSsid), anyInt(), anyInt(), any()); order.verify(mApInterface).startHostapd(); mNetworkObserverCaptor.getValue().interfaceLinkStateChanged(TEST_INTERFACE_NAME, true); |