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

Unified Diff: mojo/shell/tests/shell/driver.cc

Issue 1801963002: Change primordial pipes to ShellClient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase onto catalog CL Created 4 years, 9 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/shell/tests/connect/connect_test_driver.cc ('k') | mojo/shell/tests/util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/tests/shell/driver.cc
diff --git a/mojo/shell/tests/shell/driver.cc b/mojo/shell/tests/shell/driver.cc
index 159920dbaa04ae865e534d1aaf6bea2b5c6088d5..9d8af6bdc68a8ff7cd463e27956b57a9a8f6e28b 100644
--- a/mojo/shell/tests/shell/driver.cc
+++ b/mojo/shell/tests/shell/driver.cc
@@ -29,6 +29,7 @@
#include "mojo/shell/public/interfaces/connector.mojom.h"
#include "mojo/shell/public/interfaces/shell.mojom.h"
#include "mojo/shell/runner/child/test_native_main.h"
+#include "mojo/shell/runner/common/client_util.h"
#include "mojo/shell/runner/common/switches.h"
#include "mojo/shell/runner/init.h"
#include "mojo/shell/tests/shell/shell_unittest.mojom.h"
@@ -71,25 +72,14 @@ class Driver : public mojo::ShellClient,
platform_channel_pair.PrepareToPassClientHandleToChildProcess(
&child_command_line, &handle_passing_info);
- // Generate a token for the child to find and connect to a primordial pipe
- // and pass that as well.
- std::string primordial_pipe_token = mojo::edk::GenerateRandomToken();
- child_command_line.AppendSwitchASCII(switches::kPrimordialPipeToken,
- primordial_pipe_token);
-
- // Allocate the pipe locally.
- mojo::ScopedMessagePipeHandle pipe =
- mojo::edk::CreateParentMessagePipe(primordial_pipe_token);
-
- mojo::shell::mojom::ShellClientFactoryPtr factory;
- factory.Bind(mojo::InterfacePtrInfo<mojo::shell::mojom::ShellClientFactory>(
- std::move(pipe), 0u));
+ mojo::shell::mojom::ShellClientPtr client =
+ mojo::shell::PassShellClientRequestOnCommandLine(&child_command_line);
mojo::shell::mojom::PIDReceiverPtr receiver;
mojo::Identity target("exe:shell_unittest_target",
mojo::shell::mojom::kInheritUserID);
mojo::Connector::ConnectParams params(target);
- params.set_client_process_connection(std::move(factory),
+ params.set_client_process_connection(std::move(client),
GetProxy(&receiver));
scoped_ptr<mojo::Connection> connection = connector->Connect(&params);
connection->AddConnectionCompletedClosure(
« no previous file with comments | « mojo/shell/tests/connect/connect_test_driver.cc ('k') | mojo/shell/tests/util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698