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

Unified Diff: testing/android/native_test_launcher.cc

Issue 723343002: Update from https://crrev.com/304121 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 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_launcher.cc
diff --git a/testing/android/native_test_launcher.cc b/testing/android/native_test_launcher.cc
index 63e389aecae9cedb462e4e4fe964a406473cdb6b..b7c9d28f30787e2415cbfb90add46e776baf46ac 100644
--- a/testing/android/native_test_launcher.cc
+++ b/testing/android/native_test_launcher.cc
@@ -30,6 +30,7 @@
using testing::native_test_util::ArgsToArgv;
using testing::native_test_util::ParseArgsFromCommandLineFile;
+using testing::native_test_util::ParseArgsFromString;
using testing::native_test_util::ScopedMainEntryLogger;
// The main function of the program to be wrapped as a test apk.
@@ -117,6 +118,8 @@ void EnsureRedirectStream(FILE* stream,
static void RunTests(JNIEnv* env,
jobject obj,
+ jstring jcommand_line_flags,
+ jstring jcommand_line_file_path,
jstring jfiles_dir,
jobject app_context) {
base::AtExitManager exit_manager;
@@ -132,7 +135,17 @@ static void RunTests(JNIEnv* env,
base::android::RegisterJni(env);
std::vector<std::string> args;
- ParseArgsFromCommandLineFile(kCommandLineFilePath, &args);
+
+ const std::string command_line_file_path(
+ base::android::ConvertJavaStringToUTF8(env, jcommand_line_file_path));
+ if (command_line_file_path.empty())
+ ParseArgsFromCommandLineFile(kCommandLineFilePath, &args);
+ else
+ ParseArgsFromCommandLineFile(command_line_file_path.c_str(), &args);
+
+ const std::string command_line_flags(
+ base::android::ConvertJavaStringToUTF8(env, jcommand_line_flags));
+ ParseArgsFromString(command_line_flags, &args);
std::vector<char*> argv;
int argc = ArgsToArgv(args, &argv);

Powered by Google App Engine
This is Rietveld 408576698