| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "mojo/shell/background/background_shell.h" | 5 #include "mojo/shell/background/background_shell.h" |
| 6 | 6 |
| 7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
| 8 #include "mojo/shell/background/tests/test.mojom.h" | 8 #include "mojo/shell/background/tests/test.mojom.h" |
| 9 #include "mojo/shell/background/tests/test_catalog_store.h" | 9 #include "mojo/shell/background/tests/test_catalog_store.h" |
| 10 #include "mojo/shell/public/cpp/connector.h" | 10 #include "mojo/shell/public/cpp/connector.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 BackgroundShell background_shell; | 50 BackgroundShell background_shell; |
| 51 scoped_ptr<BackgroundShell::InitParams> init_params( | 51 scoped_ptr<BackgroundShell::InitParams> init_params( |
| 52 new BackgroundShell::InitParams); | 52 new BackgroundShell::InitParams); |
| 53 scoped_ptr<TestCatalogStore> store_ptr = BuildTestCatalogStore(); | 53 scoped_ptr<TestCatalogStore> store_ptr = BuildTestCatalogStore(); |
| 54 TestCatalogStore* store = store_ptr.get(); | 54 TestCatalogStore* store = store_ptr.get(); |
| 55 init_params->catalog_store = std::move(store_ptr); | 55 init_params->catalog_store = std::move(store_ptr); |
| 56 background_shell.Init(std::move(init_params)); | 56 background_shell.Init(std::move(init_params)); |
| 57 ShellClientImpl shell_client; | 57 ShellClientImpl shell_client; |
| 58 ShellConnection shell_connection( | 58 ShellConnection shell_connection( |
| 59 &shell_client, background_shell.CreateShellClientRequest(kTestName)); | 59 &shell_client, background_shell.CreateShellClientRequest(kTestName)); |
| 60 shell_connection.WaitForInitialize(); | |
| 61 mojom::TestServicePtr test_service; | 60 mojom::TestServicePtr test_service; |
| 62 shell_connection.connector()->ConnectToInterface( | 61 shell_connection.connector()->ConnectToInterface( |
| 63 "mojo:background_shell_test_app", &test_service); | 62 "mojo:background_shell_test_app", &test_service); |
| 64 base::RunLoop run_loop; | 63 base::RunLoop run_loop; |
| 65 bool got_result = false; | 64 bool got_result = false; |
| 66 test_service->Test([&run_loop, &got_result]() { | 65 test_service->Test([&run_loop, &got_result]() { |
| 67 got_result = true; | 66 got_result = true; |
| 68 run_loop.Quit(); | 67 run_loop.Quit(); |
| 69 }); | 68 }); |
| 70 run_loop.Run(); | 69 run_loop.Run(); |
| 71 EXPECT_TRUE(got_result); | 70 EXPECT_TRUE(got_result); |
| 72 EXPECT_TRUE(store->get_store_called()); | 71 EXPECT_TRUE(store->get_store_called()); |
| 73 } | 72 } |
| 74 | 73 |
| 75 } // namespace shell | 74 } // namespace shell |
| 76 } // namespace mojo | 75 } // namespace mojo |
| OLD | NEW |