mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Fail tests quickly if they don't start within the host activity
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=202965785
This commit is contained in:
parent
c8af6d176f
commit
e48b712a32
1 changed files with 8 additions and 1 deletions
|
|
@ -80,6 +80,7 @@ public final class HostActivity extends Activity implements SurfaceHolder.Callba
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final String TAG = "HostActivity";
|
private static final String TAG = "HostActivity";
|
||||||
|
private static final long START_TIMEOUT_MS = 5000;
|
||||||
|
|
||||||
private WakeLock wakeLock;
|
private WakeLock wakeLock;
|
||||||
private WifiLock wifiLock;
|
private WifiLock wifiLock;
|
||||||
|
|
@ -124,7 +125,13 @@ public final class HostActivity extends Activity implements SurfaceHolder.Callba
|
||||||
maybeStartHostedTest();
|
maybeStartHostedTest();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
hostedTestStartedCondition.block();
|
|
||||||
|
if (!hostedTestStartedCondition.block(START_TIMEOUT_MS)) {
|
||||||
|
String message =
|
||||||
|
"Test failed to start. Display may be turned off or keyguard may be present.";
|
||||||
|
Log.e(TAG, message);
|
||||||
|
fail(message);
|
||||||
|
}
|
||||||
|
|
||||||
if (hostedTest.blockUntilStopped(timeoutMs)) {
|
if (hostedTest.blockUntilStopped(timeoutMs)) {
|
||||||
if (!forcedStopped) {
|
if (!forcedStopped) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue