| Index: testing/android/driver/java/src/org/chromium/test/driver/OnDeviceInstrumentationDriver.java
|
| diff --git a/testing/android/driver/java/src/org/chromium/test/driver/OnDeviceInstrumentationDriver.java b/testing/android/driver/java/src/org/chromium/test/driver/OnDeviceInstrumentationDriver.java
|
| index c209ac7d15d2d76ba8adfa714b706b9c347a3bc0..f9b31b03e97830f1f162fdeeb93b7bbea7282ef9 100644
|
| --- a/testing/android/driver/java/src/org/chromium/test/driver/OnDeviceInstrumentationDriver.java
|
| +++ b/testing/android/driver/java/src/org/chromium/test/driver/OnDeviceInstrumentationDriver.java
|
| @@ -13,6 +13,7 @@ import android.os.Environment;
|
| import android.test.InstrumentationTestRunner;
|
| import android.util.Log;
|
|
|
| +import org.chromium.base.test.util.ScalableTimeout;
|
| import org.chromium.test.broker.OnDeviceInstrumentationBroker;
|
| import org.chromium.test.reporter.TestStatusReceiver;
|
| import org.chromium.test.reporter.TestStatusReporter;
|
| @@ -21,8 +22,10 @@ import org.chromium.test.support.RobotiumBundleGenerator;
|
|
|
| import java.io.BufferedReader;
|
| import java.io.File;
|
| +import java.io.FileOutputStream;
|
| import java.io.FileReader;
|
| import java.io.IOException;
|
| +import java.io.OutputStreamWriter;
|
| import java.util.ArrayList;
|
| import java.util.Arrays;
|
| import java.util.HashMap;
|
| @@ -44,6 +47,8 @@ public class OnDeviceInstrumentationDriver extends Instrumentation {
|
| "org.chromium.test.driver.OnDeviceInstrumentationDriver.TargetPackage";
|
| private static final String EXTRA_TARGET_CLASS =
|
| "org.chromium.test.driver.OnDeviceInstrumentationDriver.TargetClass";
|
| + private static final String EXTRA_TIMEOUT_SCALE =
|
| + "org.chromium.test.driver.OnDeviceInstrumentationDriver.TimeoutScale";
|
|
|
| private static final Pattern COMMA = Pattern.compile(",");
|
| private static final int TEST_WAIT_TIMEOUT = 5 * TestStatusReporter.HEARTBEAT_INTERVAL_MS;
|
| @@ -54,6 +59,7 @@ public class OnDeviceInstrumentationDriver extends Instrumentation {
|
| private String mTargetClass;
|
| private String mTargetPackage;
|
| private List<String> mTestClasses;
|
| + private String mTimeoutScale;
|
|
|
| /** Parse any arguments and prepare to run tests.
|
|
|
| @@ -101,6 +107,18 @@ public class OnDeviceInstrumentationDriver extends Instrumentation {
|
| mTargetArgs.remove(EXTRA_TEST_LIST_FILE);
|
| }
|
|
|
| + mTimeoutScale = arguments.getString(EXTRA_TIMEOUT_SCALE);
|
| + if (mTimeoutScale != null) {
|
| + try {
|
| + OutputStreamWriter outputStreamWriter = new OutputStreamWriter(
|
| + new FileOutputStream(ScalableTimeout.PROPERTY_FILE));
|
| + outputStreamWriter.write(mTimeoutScale);
|
| + outputStreamWriter.close();
|
| + } catch (IOException e) {
|
| + Log.e(TAG, "Error writing " + ScalableTimeout.PROPERTY_FILE, e);
|
| + }
|
| + }
|
| +
|
| if (mTestClasses.isEmpty()) {
|
| fail("No tests.");
|
| return;
|
| @@ -129,6 +147,11 @@ public class OnDeviceInstrumentationDriver extends Instrumentation {
|
| @Override
|
| public void onDestroy() {
|
| super.onDestroy();
|
| + if (mTimeoutScale != null) {
|
| + if (!new File(ScalableTimeout.PROPERTY_FILE).delete()) {
|
| + Log.e(TAG, "Error deleting " + ScalableTimeout.PROPERTY_FILE);
|
| + }
|
| + }
|
| }
|
|
|
| private class Driver implements Runnable {
|
|
|