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

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

Issue 1431203002: EDK: Make PlatformChannelPair not depend/use on base::CommandLine. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 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 | « mojo/edk/embedder/platform_channel_pair.cc ('k') | shell/child_main.cc » ('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 65265a3383a4031890084416c1cf1ae5da5cad11..87089e3953bf4206f39e4d0b8445c32cbf745bad 100644
--- a/mojo/edk/test/multiprocess_test_helper.cc
+++ b/mojo/edk/test/multiprocess_test_helper.cc
@@ -12,6 +12,8 @@
namespace mojo {
namespace test {
+const char kPlatformChannelHandleInfoSwitch[] = "platform-channel-handle-info";
+
MultiprocessTestHelper::MultiprocessTestHelper()
: platform_channel_pair_(new embedder::PlatformChannelPair()) {
server_platform_handle = platform_channel_pair_->PassServerHandle();
@@ -37,11 +39,15 @@ void MultiprocessTestHelper::StartChildWithExtraSwitch(
std::string test_child_main = test_child_name + "TestChildMain";
- base::CommandLine command_line(
- base::GetMultiProcessTestChildBaseCommandLine());
+ std::string string_for_child;
embedder::HandlePassingInformation handle_passing_info;
platform_channel_pair_->PrepareToPassClientHandleToChildProcess(
- &command_line, &handle_passing_info);
+ &string_for_child, &handle_passing_info);
+
+ base::CommandLine command_line(
+ base::GetMultiProcessTestChildBaseCommandLine());
+ command_line.AppendSwitchASCII(kPlatformChannelHandleInfoSwitch,
+ string_for_child);
if (!switch_string.empty()) {
CHECK(!command_line.HasSwitch(switch_string));
@@ -78,9 +84,12 @@ bool MultiprocessTestHelper::WaitForChildTestShutdown() {
// static
void MultiprocessTestHelper::ChildSetup() {
CHECK(base::CommandLine::InitializedForCurrentProcess());
+ const base::CommandLine& command_line =
+ *base::CommandLine::ForCurrentProcess();
client_platform_handle =
embedder::PlatformChannelPair::PassClientHandleFromParentProcess(
- *base::CommandLine::ForCurrentProcess());
+ command_line.GetSwitchValueASCII(kPlatformChannelHandleInfoSwitch));
+ CHECK(client_platform_handle.is_valid());
}
// static
« no previous file with comments | « mojo/edk/embedder/platform_channel_pair.cc ('k') | shell/child_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698