Skip WifiManager tests if WiFi is not supported
Some of the WifiManager tests assumed that WiFi is always supported. This is not true for all devices, for example the Android emulator, and is not a requirement in the CDD. BUG: 37633976 Test: Successfully ran 'run cts -m CtsNetTestCases' Change-Id: Ia6d62e8d2b6e0b0c2ef2fafd50529e722e4419e4
This commit is contained in:
@@ -801,7 +801,11 @@ public class WifiManagerTest extends AndroidTestCase {
|
||||
* Note: Location mode must be enabled for this test.
|
||||
*/
|
||||
public void testStartLocalOnlyHotspotSuccess() {
|
||||
// first check that softap mode is supported by the device
|
||||
if (!WifiFeature.isWifiSupported(getContext())) {
|
||||
// skip the test if WiFi is not supported
|
||||
return;
|
||||
}
|
||||
// check that softap mode is supported by the device
|
||||
if (!mWifiManager.isPortableHotspotSupported()) {
|
||||
return;
|
||||
}
|
||||
@@ -826,7 +830,11 @@ public class WifiManagerTest extends AndroidTestCase {
|
||||
* Note: Location mode must be enabled for this test.
|
||||
*/
|
||||
public void testSetWifiEnabledByAppDoesNotStopHotspot() {
|
||||
// first check that softap mode is supported by the device
|
||||
if (!WifiFeature.isWifiSupported(getContext())) {
|
||||
// skip the test if WiFi is not supported
|
||||
return;
|
||||
}
|
||||
// check that softap mode is supported by the device
|
||||
if (!mWifiManager.isPortableHotspotSupported()) {
|
||||
return;
|
||||
}
|
||||
@@ -850,7 +858,11 @@ public class WifiManagerTest extends AndroidTestCase {
|
||||
* Note: Location mode must be enabled for this test.
|
||||
*/
|
||||
public void testStartLocalOnlyHotspotSingleRequestByApps() {
|
||||
// first check that softap mode is supported by the device
|
||||
if (!WifiFeature.isWifiSupported(getContext())) {
|
||||
// skip the test if WiFi is not supported
|
||||
return;
|
||||
}
|
||||
// check that softap mode is supported by the device
|
||||
if (!mWifiManager.isPortableHotspotSupported()) {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user