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

Unified Diff: testing/android/native_test_launcher.cc

Issue 10161032: Add PathUtilsTest. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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
« no previous file with comments | « testing/android/java/src/org/chromium/native_test/ChromeNativeTestActivity.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: testing/android/native_test_launcher.cc
diff --git a/testing/android/native_test_launcher.cc b/testing/android/native_test_launcher.cc
index bc5d47f3b9313321a6800776af54e883a2864059..37dfdebf7dfdb11dc33eb8801f685e0de03a33cb 100644
--- a/testing/android/native_test_launcher.cc
+++ b/testing/android/native_test_launcher.cc
@@ -7,6 +7,7 @@
#include "base/android/jni_android.h"
#include "base/android/jni_string.h"
#include "base/android/path_utils.h"
+#include "base/android/scoped_java_ref.h"
#include "base/at_exit.h"
#include "base/command_line.h"
#include "base/file_path.h"
@@ -156,7 +157,10 @@ void LibraryLoadedOnMainThread(JNIEnv* env) {
// This method is called on a separate java thread so that we won't trigger
// an ANR.
-static void RunTests(JNIEnv* env, jobject obj, jstring jfiles_dir) {
+static void RunTests(JNIEnv* env,
+ jobject obj,
+ jstring jfiles_dir,
+ jobject app_context) {
FilePath files_dir(base::android::ConvertJavaStringToUTF8(env, jfiles_dir));
// A few options, such "--gtest_list_tests", will just use printf directly
// and won't use the "AndroidLogPrinter". Redirect stdout to a known file.
@@ -175,6 +179,11 @@ static void RunTests(JNIEnv* env, jobject obj, jstring jfiles_dir) {
AndroidLogPrinter* log = new AndroidLogPrinter();
log->Init(&argc, &argv[0]);
+ // Set the application context in base.
+ base::android::ScopedJavaLocalRef<jobject> scoped_context(
+ env, env->NewLocalRef(app_context));
+ base::android::InitApplicationContext(scoped_context);
+
main(argc, &argv[0]);
}
« no previous file with comments | « testing/android/java/src/org/chromium/native_test/ChromeNativeTestActivity.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698