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

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

Issue 1407233017: Define a Java-side global application context. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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/NativeTestActivity.java
diff --git a/testing/android/native_test/java/src/org/chromium/native_test/NativeTestActivity.java b/testing/android/native_test/java/src/org/chromium/native_test/NativeTestActivity.java
index ebe0ce3ea5b800b399a50baf972e175b78f824d7..4fa1db57e9ad0ffb87c9baa3206ba2e0e6057f65 100644
--- a/testing/android/native_test/java/src/org/chromium/native_test/NativeTestActivity.java
+++ b/testing/android/native_test/java/src/org/chromium/native_test/NativeTestActivity.java
@@ -5,7 +5,6 @@
package org.chromium.native_test;
import android.app.Activity;
-import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Environment;
@@ -13,6 +12,7 @@ import android.os.Handler;
import android.os.Process;
import org.chromium.base.CommandLine;
+import org.chromium.base.ContextUtils;
import org.chromium.base.Log;
import org.chromium.base.annotations.JNINamespace;
import org.chromium.test.reporter.TestStatusReporter;
@@ -131,8 +131,10 @@ public class NativeTestActivity extends Activity {
private void runTests() {
mReporter.testRunStarted(Process.myPid());
+ nativeInitBasicJNI();
+ ContextUtils.initApplicationContext(getApplicationContext());
nativeRunTests(mCommandLineFlags.toString(), mCommandLineFilePath, mStdoutFilePath,
- mStdoutFifo, getApplicationContext());
+ mStdoutFifo);
finish();
mReporter.testRunFinished(Process.myPid());
}
@@ -144,6 +146,7 @@ public class NativeTestActivity extends Activity {
Log.e(TAG, "[ RUNNER_FAILED ] could not load native library");
}
+ private native void nativeInitBasicJNI();
private native void nativeRunTests(String commandLineFlags, String commandLineFilePath,
- String stdoutFilePath, boolean stdoutFifo, Context appContext);
+ String stdoutFilePath, boolean stdoutFifo);
}

Powered by Google App Engine
This is Rietveld 408576698