| 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 "services/service_manager/background/background_service_manager.h" | 5 #include "services/service_manager/background/background_service_manager.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 #define MAYBE_Basic Basic | 53 #define MAYBE_Basic Basic |
| 54 #endif | 54 #endif |
| 55 TEST(BackgroundServiceManagerTest, MAYBE_Basic) { | 55 TEST(BackgroundServiceManagerTest, MAYBE_Basic) { |
| 56 BackgroundServiceManager background_service_manager; | 56 BackgroundServiceManager background_service_manager; |
| 57 base::MessageLoop message_loop; | 57 base::MessageLoop message_loop; |
| 58 background_service_manager.Init(nullptr); | 58 background_service_manager.Init(nullptr); |
| 59 ServiceContext service_context( | 59 ServiceContext service_context( |
| 60 base::MakeUnique<ServiceImpl>(), | 60 base::MakeUnique<ServiceImpl>(), |
| 61 background_service_manager.CreateServiceRequest(kTestName)); | 61 background_service_manager.CreateServiceRequest(kTestName)); |
| 62 mojom::TestServicePtr test_service; | 62 mojom::TestServicePtr test_service; |
| 63 service_context.connector()->ConnectToInterface(kAppName, &test_service); | 63 service_context.connector()->BindInterface(kAppName, &test_service); |
| 64 base::RunLoop run_loop; | 64 base::RunLoop run_loop; |
| 65 bool got_result = false; | 65 bool got_result = false; |
| 66 test_service->Test( | 66 test_service->Test( |
| 67 base::Bind(&SetFlagAndRunClosure, &got_result, run_loop.QuitClosure())); | 67 base::Bind(&SetFlagAndRunClosure, &got_result, run_loop.QuitClosure())); |
| 68 run_loop.Run(); | 68 run_loop.Run(); |
| 69 EXPECT_TRUE(got_result); | 69 EXPECT_TRUE(got_result); |
| 70 } | 70 } |
| 71 | 71 |
| 72 } // namespace service_manager | 72 } // namespace service_manager |
| OLD | NEW |