Merge "Update language to comply with Android’s inclusive language guidance." am: d0f158204f
Original change: https://android-review.googlesource.com/c/platform/cts/+/1377699 Change-Id: Ib144461d9ec7a39d8cba1e321d5a14ef698d972e
This commit is contained in:
@@ -67,7 +67,7 @@ abstract class AbstractAppIdleTestCase extends AbstractRestrictBackgroundNetwork
|
||||
setAppIdle(true);
|
||||
launchComponentAndAssertNetworkAccess(TYPE_COMPONENT_ACTIVTIY);
|
||||
finishActivity();
|
||||
assertAppIdle(false); // Sanity check - not idle anymore, since activity was launched...
|
||||
assertAppIdle(false); // verify - not idle anymore, since activity was launched...
|
||||
assertBackgroundNetworkAccess(true);
|
||||
setAppIdle(true);
|
||||
assertBackgroundNetworkAccess(false);
|
||||
@@ -86,24 +86,24 @@ abstract class AbstractAppIdleTestCase extends AbstractRestrictBackgroundNetwork
|
||||
assertBackgroundNetworkAccess(false);
|
||||
|
||||
addPowerSaveModeWhitelist(TEST_APP2_PKG);
|
||||
assertAppIdle(false); // Sanity check - not idle anymore, since whitelisted
|
||||
assertAppIdle(false); // verify - not idle anymore, since whitelisted
|
||||
assertBackgroundNetworkAccess(true);
|
||||
|
||||
removePowerSaveModeWhitelist(TEST_APP2_PKG);
|
||||
assertAppIdle(true); // Sanity check - idle again, once whitelisted was removed
|
||||
assertAppIdle(true); // verify - idle again, once whitelisted was removed
|
||||
assertBackgroundNetworkAccess(false);
|
||||
|
||||
addPowerSaveModeExceptIdleWhitelist(TEST_APP2_PKG);
|
||||
assertAppIdle(false); // Sanity check - not idle anymore, since whitelisted
|
||||
assertAppIdle(false); // verify - not idle anymore, since whitelisted
|
||||
assertBackgroundNetworkAccess(true);
|
||||
|
||||
removePowerSaveModeExceptIdleWhitelist(TEST_APP2_PKG);
|
||||
assertAppIdle(true); // Sanity check - idle again, once whitelisted was removed
|
||||
assertAppIdle(true); // verify - idle again, once whitelisted was removed
|
||||
assertBackgroundNetworkAccess(false);
|
||||
|
||||
assertsForegroundAlwaysHasNetworkAccess();
|
||||
|
||||
// Sanity check - no whitelist, no access!
|
||||
// verify - no whitelist, no access!
|
||||
setAppIdle(true);
|
||||
assertBackgroundNetworkAccess(false);
|
||||
}
|
||||
|
||||
@@ -240,12 +240,12 @@ public abstract class AbstractRestrictBackgroundNetworkTestCase {
|
||||
}
|
||||
|
||||
protected void assertBackgroundNetworkAccess(boolean expectAllowed) throws Exception {
|
||||
assertBackgroundState(); // Sanity check.
|
||||
assertBackgroundState();
|
||||
assertNetworkAccess(expectAllowed /* expectAvailable */, false /* needScreenOn */);
|
||||
}
|
||||
|
||||
protected void assertForegroundNetworkAccess() throws Exception {
|
||||
assertForegroundState(); // Sanity check.
|
||||
assertForegroundState();
|
||||
// We verified that app is in foreground state but if the screen turns-off while
|
||||
// verifying for network access, the app will go into background state (in case app's
|
||||
// foreground status was due to top activity). So, turn the screen on when verifying
|
||||
@@ -254,7 +254,7 @@ public abstract class AbstractRestrictBackgroundNetworkTestCase {
|
||||
}
|
||||
|
||||
protected void assertForegroundServiceNetworkAccess() throws Exception {
|
||||
assertForegroundServiceState(); // Sanity check.
|
||||
assertForegroundServiceState();
|
||||
assertNetworkAccess(true /* expectAvailable */, false /* needScreenOn */);
|
||||
}
|
||||
|
||||
@@ -385,7 +385,7 @@ public abstract class AbstractRestrictBackgroundNetworkTestCase {
|
||||
}
|
||||
// Network status format is described on MyBroadcastReceiver.checkNetworkStatus()
|
||||
final String[] parts = resultData.split(NETWORK_STATUS_SEPARATOR);
|
||||
assertEquals("Wrong network status: " + resultData, 5, parts.length); // Sanity check
|
||||
assertEquals("Wrong network status: " + resultData, 5, parts.length);
|
||||
final State state = parts[0].equals("null") ? null : State.valueOf(parts[0]);
|
||||
final DetailedState detailedState = parts[1].equals("null")
|
||||
? null : DetailedState.valueOf(parts[1]);
|
||||
@@ -558,7 +558,7 @@ public abstract class AbstractRestrictBackgroundNetworkTestCase {
|
||||
// TODO: currently the power-save mode is behaving like idle, but once it changes, we'll
|
||||
// need to use netpolicy for whitelisting
|
||||
executeShellCommand("dumpsys deviceidle whitelist +" + packageName);
|
||||
assertPowerSaveModeWhitelist(packageName, true); // Sanity check
|
||||
assertPowerSaveModeWhitelist(packageName, true);
|
||||
}
|
||||
|
||||
protected void removePowerSaveModeWhitelist(String packageName) throws Exception {
|
||||
@@ -566,7 +566,7 @@ public abstract class AbstractRestrictBackgroundNetworkTestCase {
|
||||
// TODO: currently the power-save mode is behaving like idle, but once it changes, we'll
|
||||
// need to use netpolicy for whitelisting
|
||||
executeShellCommand("dumpsys deviceidle whitelist -" + packageName);
|
||||
assertPowerSaveModeWhitelist(packageName, false); // Sanity check
|
||||
assertPowerSaveModeWhitelist(packageName, false);
|
||||
}
|
||||
|
||||
protected void assertPowerSaveModeExceptIdleWhitelist(String packageName, boolean expected)
|
||||
@@ -582,7 +582,7 @@ public abstract class AbstractRestrictBackgroundNetworkTestCase {
|
||||
// TODO: currently the power-save mode is behaving like idle, but once it changes, we'll
|
||||
// need to use netpolicy for whitelisting
|
||||
executeShellCommand("dumpsys deviceidle except-idle-whitelist +" + packageName);
|
||||
assertPowerSaveModeExceptIdleWhitelist(packageName, true); // Sanity check
|
||||
assertPowerSaveModeExceptIdleWhitelist(packageName, true);
|
||||
}
|
||||
|
||||
protected void removePowerSaveModeExceptIdleWhitelist(String packageName) throws Exception {
|
||||
@@ -591,7 +591,7 @@ public abstract class AbstractRestrictBackgroundNetworkTestCase {
|
||||
// TODO: currently the power-save mode is behaving like idle, but once it changes, we'll
|
||||
// need to use netpolicy for whitelisting
|
||||
executeShellCommand("dumpsys deviceidle except-idle-whitelist reset");
|
||||
assertPowerSaveModeExceptIdleWhitelist(packageName, false); // Sanity check
|
||||
assertPowerSaveModeExceptIdleWhitelist(packageName, false);
|
||||
}
|
||||
|
||||
protected void turnBatteryOn() throws Exception {
|
||||
@@ -646,7 +646,7 @@ public abstract class AbstractRestrictBackgroundNetworkTestCase {
|
||||
}
|
||||
|
||||
protected void setDozeMode(boolean enabled) throws Exception {
|
||||
// Sanity check, since tests should check beforehand....
|
||||
// Check doze mode is supported.
|
||||
assertTrue("Device does not support Doze Mode", isDozeModeSupported());
|
||||
|
||||
Log.i(TAG, "Setting Doze Mode to " + enabled);
|
||||
@@ -659,7 +659,6 @@ public abstract class AbstractRestrictBackgroundNetworkTestCase {
|
||||
turnBatteryOff();
|
||||
executeShellCommand("dumpsys deviceidle unforce");
|
||||
}
|
||||
// Sanity check.
|
||||
assertDozeMode(enabled);
|
||||
}
|
||||
|
||||
@@ -670,7 +669,7 @@ public abstract class AbstractRestrictBackgroundNetworkTestCase {
|
||||
protected void setAppIdle(boolean enabled) throws Exception {
|
||||
Log.i(TAG, "Setting app idle to " + enabled);
|
||||
executeSilentShellCommand("am set-inactive " + TEST_APP2_PKG + " " + enabled );
|
||||
assertAppIdle(enabled); // Sanity check
|
||||
assertAppIdle(enabled);
|
||||
}
|
||||
|
||||
protected void assertAppIdle(boolean enabled) throws Exception {
|
||||
|
||||
@@ -67,7 +67,7 @@ public class DataSaverModeTest extends AbstractRestrictBackgroundNetworkTestCase
|
||||
public void testGetRestrictBackgroundStatus_disabled() throws Exception {
|
||||
assertDataSaverStatusOnBackground(RESTRICT_BACKGROUND_STATUS_DISABLED);
|
||||
|
||||
// Sanity check: make sure status is always disabled, never whitelisted
|
||||
// Verify status is always disabled, never whitelisted
|
||||
addRestrictBackgroundWhitelist(mUid);
|
||||
assertRestrictBackgroundChangedReceived(0);
|
||||
assertDataSaverStatusOnBackground(RESTRICT_BACKGROUND_STATUS_DISABLED);
|
||||
|
||||
@@ -367,7 +367,7 @@ public class HostsideRestrictBackgroundNetworkTests extends HostsideNetworkTestC
|
||||
// TODO: currently the power-save mode is behaving like idle, but once it changes, we'll
|
||||
// need to use netpolicy for whitelisting
|
||||
runCommand("dumpsys deviceidle whitelist +" + packageName);
|
||||
assertPowerSaveModeWhitelist(packageName, true); // Sanity check
|
||||
assertPowerSaveModeWhitelist(packageName, true);
|
||||
}
|
||||
|
||||
protected boolean isDozeModeEnabled() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user