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

Unified Diff: mojo/edk/test/multiprocess_test_helper.cc

Issue 1146163002: Revert "Revert multiple commits:" (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: the fix Created 5 years, 7 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 | « mojo/edk/test/multiprocess_test_helper.h ('k') | mojo/edk/test/scoped_ipc_support.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/edk/test/multiprocess_test_helper.cc
diff --git a/mojo/edk/test/multiprocess_test_helper.cc b/mojo/edk/test/multiprocess_test_helper.cc
index 6dd8b72a088d2b4aa939902e159258749a17be8b..c107a02da2abf627778b6c4807fc3600e4d3ffc6 100644
--- a/mojo/edk/test/multiprocess_test_helper.cc
+++ b/mojo/edk/test/multiprocess_test_helper.cc
@@ -26,6 +26,13 @@ MultiprocessTestHelper::~MultiprocessTestHelper() {
}
void MultiprocessTestHelper::StartChild(const std::string& test_child_name) {
+ StartChildWithExtraSwitch(test_child_name, std::string(), std::string());
+}
+
+void MultiprocessTestHelper::StartChildWithExtraSwitch(
+ const std::string& test_child_name,
+ const std::string& switch_string,
+ const std::string& switch_value) {
CHECK(platform_channel_pair_);
CHECK(!test_child_name.empty());
CHECK(!test_child_.IsValid());
@@ -38,6 +45,14 @@ void MultiprocessTestHelper::StartChild(const std::string& test_child_name) {
platform_channel_pair_->PrepareToPassClientHandleToChildProcess(
&command_line, &handle_passing_info);
+ if (!switch_string.empty()) {
+ CHECK(!command_line.HasSwitch(switch_string));
+ if (!switch_value.empty())
+ command_line.AppendSwitchASCII(switch_string, switch_value);
+ else
+ command_line.AppendSwitch(switch_string);
+ }
+
base::LaunchOptions options;
#if defined(OS_POSIX)
options.fds_to_remap = &handle_passing_info;
« no previous file with comments | « mojo/edk/test/multiprocess_test_helper.h ('k') | mojo/edk/test/scoped_ipc_support.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698