Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(82)

Unified Diff: testing/android/native_test/java/src/org/chromium/native_test/NativeTestInstrumentationTestRunner.java

Issue 1138993009: Revert of [Android] Refactor the native test wrappers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: testing/android/native_test/java/src/org/chromium/native_test/NativeTestInstrumentationTestRunner.java
diff --git a/testing/android/native_test/java/src/org/chromium/native_test/NativeTestInstrumentationTestRunner.java b/testing/android/native_test/java/src/org/chromium/native_test/NativeTestInstrumentationTestRunner.java
index e1f6f14cfa3420ab13364a2bf79d906b88413019..c5a4443e1a4c1c6122638dc793aab6691397f92d 100644
--- a/testing/android/native_test/java/src/org/chromium/native_test/NativeTestInstrumentationTestRunner.java
+++ b/testing/android/native_test/java/src/org/chromium/native_test/NativeTestInstrumentationTestRunner.java
@@ -31,9 +31,6 @@
* An Instrumentation that runs tests based on NativeTestActivity.
*/
public class NativeTestInstrumentationTestRunner extends Instrumentation {
- public static final String EXTRA_NATIVE_TEST_ACTIVITY =
- "org.chromium.native_test.NativeTestInstrumentationTestRunner."
- + "NativeTestActivity";
// TODO(jbudorick): Remove this extra when b/18981674 is fixed.
public static final String EXTRA_ONLY_OUTPUT_FAILURES =
"org.chromium.native_test.NativeTestInstrumentationTestRunner."
@@ -42,25 +39,19 @@
private static final String TAG = Log.makeTag("native_test");
private static final int ACCEPT_TIMEOUT_MS = 5000;
- private static final String DEFAULT_NATIVE_TEST_ACTIVITY =
- "org.chromium.native_test.NativeUnitTestActivity";
private static final Pattern RE_TEST_OUTPUT = Pattern.compile("\\[ *([^ ]*) *\\] ?([^ ]+) .*");
- private ResultsBundleGenerator mBundleGenerator = new RobotiumBundleGenerator();
private String mCommandLineFile;
private String mCommandLineFlags;
- private String mNativeTestActivity;
- private Bundle mLogBundle = new Bundle();
+ private File mStdoutFile;
+ private Bundle mLogBundle;
+ private ResultsBundleGenerator mBundleGenerator;
private boolean mOnlyOutputFailures;
- private File mStdoutFile;
@Override
public void onCreate(Bundle arguments) {
mCommandLineFile = arguments.getString(NativeTestActivity.EXTRA_COMMAND_LINE_FILE);
mCommandLineFlags = arguments.getString(NativeTestActivity.EXTRA_COMMAND_LINE_FLAGS);
- mNativeTestActivity = arguments.getString(EXTRA_NATIVE_TEST_ACTIVITY);
- if (mNativeTestActivity == null) mNativeTestActivity = DEFAULT_NATIVE_TEST_ACTIVITY;
-
try {
mStdoutFile = File.createTempFile(
".temp_stdout_", ".txt", Environment.getExternalStorageDirectory());
@@ -70,7 +61,8 @@
finish(Activity.RESULT_CANCELED, new Bundle());
return;
}
-
+ mLogBundle = new Bundle();
+ mBundleGenerator = new RobotiumBundleGenerator();
mOnlyOutputFailures = arguments.containsKey(EXTRA_ONLY_OUTPUT_FAILURES);
start();
}
@@ -108,7 +100,9 @@
*/
private Activity startNativeTestActivity() {
Intent i = new Intent(Intent.ACTION_MAIN);
- i.setComponent(new ComponentName(getContext().getPackageName(), mNativeTestActivity));
+ i.setComponent(new ComponentName(
+ "org.chromium.native_test",
+ "org.chromium.native_test.NativeTestActivity"));
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
if (mCommandLineFile != null) {
Log.i(TAG, "Passing command line file extra: %s", mCommandLineFile);

Powered by Google App Engine
This is Rietveld 408576698