diff options
author | Ahmed ElArabawy <arabawy@google.com> | 2019-12-13 19:46:55 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2019-12-13 19:46:55 +0000 |
commit | ec3061ae838eb7e867e4b54dea2dc40d96296ac8 (patch) | |
tree | 6556ceb4c797d6ea53961b7d0b758411dbc80485 /tests | |
parent | cdf50099aceca8271b620588ad48ee0d7e2f3cc4 (diff) | |
parent | 6921b854a62b2959a4b03088091e7c84641dabb0 (diff) |
Merge "Wifi: Replace dual_band with 5GHz band support"
Diffstat (limited to 'tests')
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java | 6 | ||||
-rw-r--r-- | tests/wifitests/src/com/android/server/wifi/WifiVendorHalTest.java | 80 |
2 files changed, 3 insertions, 83 deletions
diff --git a/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java b/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java index 0273211c7..f3cf19fd6 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiServiceImplTest.java @@ -32,7 +32,6 @@ import static android.net.wifi.WifiManager.WIFI_AP_STATE_DISABLED; import static android.net.wifi.WifiManager.WIFI_AP_STATE_DISABLING; import static android.net.wifi.WifiManager.WIFI_AP_STATE_ENABLED; import static android.net.wifi.WifiManager.WIFI_AP_STATE_FAILED; -import static android.net.wifi.WifiManager.WIFI_FEATURE_INFRA_5G; import static android.net.wifi.WifiManager.WIFI_STATE_DISABLED; import static com.android.server.wifi.LocalOnlyHotspotRequestInfo.HOTSPOT_NO_ERROR; @@ -1864,9 +1863,10 @@ public class WifiServiceImplTest extends WifiBaseTest { when(mResources.getBoolean( eq(R.bool.config_wifi_local_only_hotspot_5ghz))) .thenReturn(true); + when(mResources.getBoolean( + eq(R.bool.config_wifi5ghzSupport))) + .thenReturn(true); when(mPackageManager.hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE)).thenReturn(true); - when(mClientModeImpl.syncGetSupportedFeatures(any(AsyncChannel.class))) - .thenReturn((long) WIFI_FEATURE_INFRA_5G); verify(mAsyncChannel).connect(any(), mHandlerCaptor.capture(), any(Handler.class)); final Handler handler = mHandlerCaptor.getValue(); diff --git a/tests/wifitests/src/com/android/server/wifi/WifiVendorHalTest.java b/tests/wifitests/src/com/android/server/wifi/WifiVendorHalTest.java index 3d290e450..74053519b 100644 --- a/tests/wifitests/src/com/android/server/wifi/WifiVendorHalTest.java +++ b/tests/wifitests/src/com/android/server/wifi/WifiVendorHalTest.java @@ -157,8 +157,6 @@ public class WifiVendorHalTest extends WifiBaseTest { private android.hardware.wifi.V1_2.IWifiStaIface mIWifiStaIfaceV12; @Mock private android.hardware.wifi.V1_3.IWifiStaIface mIWifiStaIfaceV13; - @Mock - private android.hardware.wifi.V1_4.IWifiStaIface mIWifiStaIfaceV14; private IWifiStaIfaceEventCallback mIWifiStaIfaceEventCallback; private IWifiChipEventCallback mIWifiChipEventCallback; private android.hardware.wifi.V1_2.IWifiChipEventCallback mIWifiChipEventCallbackV12; @@ -208,12 +206,6 @@ public class WifiVendorHalTest extends WifiBaseTest { String ifaceName) { return null; } - - @Override - protected android.hardware.wifi.V1_4.IWifiStaIface getWifiStaIfaceForV1_4Mockable( - String ifaceName) { - return null; - } } /** @@ -256,12 +248,6 @@ public class WifiVendorHalTest extends WifiBaseTest { String ifaceName) { return null; } - - @Override - protected android.hardware.wifi.V1_4.IWifiStaIface getWifiStaIfaceForV1_4Mockable( - String ifaceName) { - return null; - } } /** @@ -304,12 +290,6 @@ public class WifiVendorHalTest extends WifiBaseTest { String ifaceName) { return mIWifiStaIfaceV13; } - - @Override - protected android.hardware.wifi.V1_4.IWifiStaIface getWifiStaIfaceForV1_4Mockable( - String ifaceName) { - return null; - } } /** @@ -352,12 +332,6 @@ public class WifiVendorHalTest extends WifiBaseTest { String ifaceName) { return mIWifiStaIfaceV13; } - - @Override - protected android.hardware.wifi.V1_4.IWifiStaIface getWifiStaIfaceForV1_4Mockable( - String ifaceName) { - return mIWifiStaIfaceV14; - } } /** @@ -914,60 +888,6 @@ public class WifiVendorHalTest extends WifiBaseTest { assertEquals(expectedFeatureSet, mWifiVendorHal.getSupportedFeatureSet(TEST_IFACE_NAME)); } - /** - * Test get supported features on HAL V1_4. - * Tests whether we coalesce information from different sources - * (IWifiStaIface, IWifiChip and HalDeviceManager) into the bitmask of supported features - * correctly. - */ - @Test - public void testGetSupportedFeaturesV1_4() throws Exception { - mWifiVendorHal = new WifiVendorHalSpyV1_4(mHalDeviceManager, mHandler); - assertTrue(mWifiVendorHal.startVendorHalSta()); - - int staIfaceHidlCaps = ( - IWifiStaIface.StaIfaceCapabilityMask.BACKGROUND_SCAN - | IWifiStaIface.StaIfaceCapabilityMask.LINK_LAYER_STATS - | android.hardware.wifi.V1_4.IWifiStaIface.StaIfaceCapabilityMask.STA_6G - ); - int chipHidlCaps = - android.hardware.wifi.V1_1.IWifiChip.ChipCapabilityMask.SET_TX_POWER_LIMIT; - Set<Integer> halDeviceManagerSupportedIfaces = new HashSet<Integer>() {{ - add(IfaceType.STA); - add(IfaceType.P2P); - }}; - long expectedFeatureSet = ( - WifiManager.WIFI_FEATURE_SCANNER - | WifiManager.WIFI_FEATURE_LINK_LAYER_STATS - | WifiManager.WIFI_FEATURE_TX_POWER_LIMIT - | WifiManager.WIFI_FEATURE_INFRA - | WifiManager.WIFI_FEATURE_P2P - | WifiManager.WIFI_FEATURE_INFRA_6G - ); - - doAnswer(new AnswerWithArguments() { - public void answer( - android.hardware.wifi.V1_4.IWifiStaIface.getCapabilities_1_4Callback cb) - throws RemoteException { - cb.onValues(mWifiStatusSuccess, staIfaceHidlCaps); - } - }).when(mIWifiStaIfaceV14).getCapabilities_1_4( - any(android.hardware.wifi.V1_4.IWifiStaIface.getCapabilities_1_4Callback.class)); - - doAnswer(new AnswerWithArguments() { - public void answer(android.hardware.wifi.V1_3.IWifiChip.getCapabilities_1_3Callback cb) - throws RemoteException { - cb.onValues(mWifiStatusSuccess, chipHidlCaps); - } - }).when(mIWifiChipV13).getCapabilities_1_3( - any(android.hardware.wifi.V1_3.IWifiChip.getCapabilities_1_3Callback.class)); - - when(mHalDeviceManager.getSupportedIfaceTypes()) - .thenReturn(halDeviceManagerSupportedIfaces); - - assertEquals(expectedFeatureSet, mWifiVendorHal.getSupportedFeatureSet(TEST_IFACE_NAME)); - } - /** * Test |getFactoryMacAddress| gets called when the hal version is V1_3 * @throws Exception |