Merge "[Wifi] Update CTS test for Wifi Locks"
This commit is contained in:
committed by
Android (Google) Code Review
commit
eb787b81e4
@@ -25,13 +25,27 @@ public class WifiManager_WifiLockTest extends AndroidTestCase {
|
||||
|
||||
private static final String WIFI_TAG = "WifiManager_WifiLockTest";
|
||||
|
||||
public void testWifiLock() {
|
||||
/**
|
||||
* Verify acquire and release of High Performance wifi locks
|
||||
*/
|
||||
public void testHiPerfWifiLock() {
|
||||
testWifiLock(WifiManager.WIFI_MODE_FULL_HIGH_PERF);
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify acquire and release of Low latency wifi locks
|
||||
*/
|
||||
public void testLowLatencyWifiLock() {
|
||||
testWifiLock(WifiManager.WIFI_MODE_FULL_LOW_LATENCY);
|
||||
}
|
||||
|
||||
private void testWifiLock(int lockType) {
|
||||
if (!WifiFeature.isWifiSupported(getContext())) {
|
||||
// skip the test if WiFi is not supported
|
||||
return;
|
||||
}
|
||||
WifiManager wm = (WifiManager) getContext().getSystemService(Context.WIFI_SERVICE);
|
||||
WifiLock wl = wm.createWifiLock(WIFI_TAG);
|
||||
WifiLock wl = wm.createWifiLock(lockType, WIFI_TAG);
|
||||
|
||||
wl.setReferenceCounted(true);
|
||||
assertFalse(wl.isHeld());
|
||||
@@ -55,7 +69,7 @@ public class WifiManager_WifiLockTest extends AndroidTestCase {
|
||||
// expected
|
||||
}
|
||||
|
||||
wl = wm.createWifiLock(WIFI_TAG);
|
||||
wl = wm.createWifiLock(lockType, WIFI_TAG);
|
||||
wl.setReferenceCounted(false);
|
||||
assertFalse(wl.isHeld());
|
||||
wl.acquire();
|
||||
|
||||
Reference in New Issue
Block a user