Force stop hosted test after timeout.

When hosted tests run into a timeout, the outer test method stops.
However, the hosted test itself may continue running and needs to be
forced-stopped to ensure it does not block any resources needed by
subsequent test methods.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=166208204
This commit is contained in:
tonihei 2017-08-23 09:04:29 -07:00 committed by Oliver Woodman
parent eeebb3968b
commit aa712114c6

View File

@ -137,6 +137,12 @@ public final class HostActivity extends Activity implements SurfaceHolder.Callba
fail(message);
}
} else {
runOnUiThread(new Runnable() {
@Override
public void run() {
hostedTest.forceStop();
}
});
String message = "Test timed out after " + timeoutMs + " ms.";
Log.e(TAG, message);
if (failOnTimeout) {