| 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);
|
| }
|
|
|