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/shell/background/background_shell.h" | 5 #include "services/service_manager/background/background_shell.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" |
11 #include "services/shell/background/tests/test.mojom.h" | 11 #include "services/service_manager/background/tests/test.mojom.h" |
12 #include "services/shell/public/cpp/connector.h" | 12 #include "services/service_manager/public/cpp/connector.h" |
13 #include "services/shell/public/cpp/service.h" | 13 #include "services/service_manager/public/cpp/service.h" |
14 #include "services/shell/public/cpp/service_context.h" | 14 #include "services/service_manager/public/cpp/service_context.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
16 | 16 |
17 namespace shell { | 17 namespace shell { |
18 namespace { | 18 namespace { |
19 | 19 |
20 const char kTestName[] = "service:background_shell_unittest"; | 20 const char kTestName[] = "service:background_shell_unittest"; |
21 const char kAppName[] = "service:background_shell_test_service"; | 21 const char kAppName[] = "service:background_shell_test_service"; |
22 | 22 |
23 class ServiceImpl : public Service { | 23 class ServiceImpl : public Service { |
24 public: | 24 public: |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 service_context.connector()->ConnectToInterface(kAppName, &test_service); | 56 service_context.connector()->ConnectToInterface(kAppName, &test_service); |
57 base::RunLoop run_loop; | 57 base::RunLoop run_loop; |
58 bool got_result = false; | 58 bool got_result = false; |
59 test_service->Test(base::Bind(&SetFlagAndRunClosure, &got_result, | 59 test_service->Test(base::Bind(&SetFlagAndRunClosure, &got_result, |
60 run_loop.QuitClosure())); | 60 run_loop.QuitClosure())); |
61 run_loop.Run(); | 61 run_loop.Run(); |
62 EXPECT_TRUE(got_result); | 62 EXPECT_TRUE(got_result); |
63 } | 63 } |
64 | 64 |
65 } // namespace shell | 65 } // namespace shell |
OLD | NEW |