Merge "Try to fix HostsideRestrictBackgroundNetworkTests flakyness." into oc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
c7e8f9091f
@@ -782,7 +782,7 @@ abstract class AbstractRestrictBackgroundNetworkTestCase extends Instrumentation
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void assertAppIdle(boolean enabled) throws Exception {
|
protected void assertAppIdle(boolean enabled) throws Exception {
|
||||||
assertDelayedShellCommand("am get-inactive " + TEST_APP2_PKG, 10, 2, "Idle=" + enabled);
|
assertDelayedShellCommand("am get-inactive " + TEST_APP2_PKG, 15, 2, "Idle=" + enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -848,6 +848,8 @@ abstract class AbstractRestrictBackgroundNetworkTestCase extends Instrumentation
|
|||||||
return;
|
return;
|
||||||
} else if (type == TYPE_COMPONENT_ACTIVTIY) {
|
} else if (type == TYPE_COMPONENT_ACTIVTIY) {
|
||||||
turnScreenOn();
|
turnScreenOn();
|
||||||
|
// Wait for screen-on state to propagate through the system.
|
||||||
|
SystemClock.sleep(2000);
|
||||||
final CountDownLatch latch = new CountDownLatch(1);
|
final CountDownLatch latch = new CountDownLatch(1);
|
||||||
final Intent launchIntent = getIntentForComponent(type);
|
final Intent launchIntent = getIntentForComponent(type);
|
||||||
final Bundle extras = new Bundle();
|
final Bundle extras = new Bundle();
|
||||||
|
|||||||
Reference in New Issue
Block a user