Index: testing/android/native_test/native_test_launcher.cc |
diff --git a/testing/android/native_test/native_test_launcher.cc b/testing/android/native_test/native_test_launcher.cc |
index 5d392891b2e04db42a70707fd80d75fc3d5b303a..3b5ee8328036995724e78db3404578468ed62cad 100644 |
--- a/testing/android/native_test/native_test_launcher.cc |
+++ b/testing/android/native_test/native_test_launcher.cc |
@@ -24,6 +24,7 @@ |
#include "base/files/file_util.h" |
#include "base/logging.h" |
#include "base/strings/stringprintf.h" |
+#include "base/test/test_support_android.h" |
#include "gtest/gtest.h" |
#include "jni/NativeTest_jni.h" |
#include "testing/android/native_test/native_test_util.h" |
@@ -70,7 +71,8 @@ static void RunTests(JNIEnv* env, |
const JavaParamRef<jstring>& jcommand_line_file_path, |
const JavaParamRef<jstring>& jstdout_file_path, |
jboolean jstdout_fifo, |
- const JavaParamRef<jobject>& app_context) { |
+ const JavaParamRef<jobject>& app_context, |
+ const JavaParamRef<jstring>& jtest_data_dir) { |
// Command line initialized basically, will be fully initialized later. |
static const char* const kInitialArgv[] = { "ChromeTestActivity" }; |
base::CommandLine::Init(arraysize(kInitialArgv), kInitialArgv); |
@@ -124,6 +126,10 @@ static void RunTests(JNIEnv* env, |
base::debug::WaitForDebugger(24 * 60 * 60, false); |
} |
+ base::FilePath test_data_dir( |
+ base::android::ConvertJavaStringToUTF8(env, jtest_data_dir)); |
+ base::InitAndroidTestPaths(test_data_dir); |
+ |
ScopedMainEntryLogger scoped_main_entry_logger; |
main(argc, &argv[0]); |
} |