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

Unified Diff: mojo/shell/background/tests/test_service.cc

Issue 1801963002: Change primordial pipes to ShellClient (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
Index: mojo/shell/background/tests/test_service.cc
diff --git a/mojo/shell/background/tests/test_service.cc b/mojo/shell/background/tests/test_service.cc
index 8b68c59aebcf00ded32de33e2f01291536e9aace..0c72b1c3aa4eed37f77aa433e728fd1cdd99373a 100644
--- a/mojo/shell/background/tests/test_service.cc
+++ b/mojo/shell/background/tests/test_service.cc
@@ -16,7 +16,7 @@ class TestClient : public ShellClient,
public InterfaceFactory<mojom::TestService>,
public mojom::TestService {
public:
- TestClient() {}
+ explicit TestClient(mojo::ApplicationRunner* runner) : runner_(runner) {}
~TestClient() override {}
private:
@@ -25,6 +25,9 @@ class TestClient : public ShellClient,
connection->AddInterface(this);
return true;
}
+ void ShellConnectionLost() override {
+ runner_->Quit();
+ }
// InterfaceFactory<mojom::TestService>:
void Create(Connection* connection,
@@ -35,6 +38,7 @@ class TestClient : public ShellClient,
// mojom::TestService
void Test(const TestCallback& callback) override { callback.Run(); }
+ mojo::ApplicationRunner* const runner_;
BindingSet<mojom::TestService> bindings_;
DISALLOW_COPY_AND_ASSIGN(TestClient);
@@ -44,6 +48,6 @@ class TestClient : public ShellClient,
} // namespace mojo
MojoResult MojoMain(MojoHandle shell_handle) {
- mojo::ApplicationRunner runner(new mojo::shell::TestClient);
+ mojo::ApplicationRunner runner(new mojo::shell::TestClient(&runner));
return runner.Run(shell_handle);
}
« no previous file with comments | « mojo/mojo_shell.gyp ('k') | mojo/shell/native_runner.h » ('j') | mojo/shell/shell.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698