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

Unified Diff: mojo/shell/tests/lifecycle/lifecycle_unittest.cc

Issue 1776513003: Allow client process information to be passed via Connector::Connect(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . 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/shell.cc ('k') | mojo/shell/tests/shell/driver.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/shell/tests/lifecycle/lifecycle_unittest.cc
diff --git a/mojo/shell/tests/lifecycle/lifecycle_unittest.cc b/mojo/shell/tests/lifecycle/lifecycle_unittest.cc
index a9829f8637885b33b76576a21f0c40d0c3c0e933..36fec24c7d74e26659e96cda39790d58139ee843 100644
--- a/mojo/shell/tests/lifecycle/lifecycle_unittest.cc
+++ b/mojo/shell/tests/lifecycle/lifecycle_unittest.cc
@@ -182,10 +182,6 @@ class LifecycleTest : public mojo::test::ShellTest {
child_command_line.AppendSwitch(switches::kWaitForDebugger);
}
- mojo::shell::mojom::PIDReceiverPtr receiver;
- mojo::InterfaceRequest<mojo::shell::mojom::PIDReceiver> request =
- GetProxy(&receiver);
-
// Create the channel to be shared with the target process. Pass one end
// on the command line.
mojo::edk::PlatformChannelPair platform_channel_pair;
@@ -209,13 +205,15 @@ class LifecycleTest : public mojo::test::ShellTest {
mojo::shell::mojom::ShellClientFactoryPtr factory;
factory.Bind(mojo::InterfacePtrInfo<mojo::shell::mojom::ShellClientFactory>(
std::move(pipe), 0u));
+ mojo::shell::mojom::PIDReceiverPtr receiver;
+
+ mojo::Identity target(kTestExeName, mojo::shell::mojom::kInheritUserID);
+ mojo::Connector::ConnectParams params(target);
+ params.set_client_process_connection(std::move(factory),
+ GetProxy(&receiver));
+ scoped_ptr<mojo::Connection> connection = connector()->Connect(&params);
base::RunLoop loop;
- mojo::Identity target(kTestExeName, mojom::kInheritUserID);
- shell->CreateInstance(std::move(factory),
- mojo::shell::mojom::Identity::From(target),
- std::move(request),
- base::Bind(&LifecycleTest::OnConnectionCompleted,
- base::Unretained(this), &loop));
+ connection->AddConnectionCompletedClosure(base::Bind(&QuitLoop, &loop));
loop.Run();
base::LaunchOptions options;
@@ -258,11 +256,6 @@ class LifecycleTest : public mojo::test::ShellTest {
return make_scoped_ptr(state);
}
- void OnConnectionCompleted(base::RunLoop* loop,
- mojom::ConnectResult result) {
- loop->Quit();
- }
-
scoped_ptr<InstanceState> instances_;
DISALLOW_COPY_AND_ASSIGN(LifecycleTest);
« no previous file with comments | « mojo/shell/shell.cc ('k') | mojo/shell/tests/shell/driver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698