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

Unified Diff: base/test/multiprocess_test_android.cc

Issue 734063004: Update from https://crrev.com/304418 (Closed) Base URL: https://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
« no previous file with comments | « base/sys_info_android.cc ('k') | build/all.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/test/multiprocess_test_android.cc
diff --git a/base/test/multiprocess_test_android.cc b/base/test/multiprocess_test_android.cc
index 4cfae5ecaacd51449e018018b2b9579de09d50bc..8f54b82b5ea4512bf15c4e3b21116e495a7783cb 100644
--- a/base/test/multiprocess_test_android.cc
+++ b/base/test/multiprocess_test_android.cc
@@ -2,13 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/posix/global_descriptors.h"
#include "base/test/multiprocess_test.h"
#include <unistd.h>
+#include "base/base_switches.h"
+#include "base/command_line.h"
#include "base/containers/hash_tables.h"
#include "base/logging.h"
+#include "base/posix/global_descriptors.h"
#include "testing/multiprocess_func_list.h"
namespace base {
@@ -16,7 +18,6 @@ namespace base {
// A very basic implementation for Android. On Android tests can run in an APK
// and we don't have an executable to exec*. This implementation does the bare
// minimum to execute the method specified by procname (in the child process).
-// - |base_command_line| is ignored.
// - All options except |fds_to_remap| are ignored.
ProcessHandle SpawnMultiProcessTestChild(const std::string& procname,
const CommandLine& base_command_line,
@@ -60,6 +61,13 @@ ProcessHandle SpawnMultiProcessTestChild(const std::string& procname,
}
close(old_fd);
}
+ CommandLine::Reset();
+ CommandLine::Init(0, nullptr);
+ CommandLine* command_line = CommandLine::ForCurrentProcess();
+ command_line->InitFromArgv(base_command_line.argv());
+ if (!command_line->HasSwitch(switches::kTestChildProcess))
+ command_line->AppendSwitchASCII(switches::kTestChildProcess, procname);
+
_exit(multi_process_function_list::InvokeChildProcessTest(procname));
return 0;
}
« no previous file with comments | « base/sys_info_android.cc ('k') | build/all.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698