OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // Note: This file also tests child_process.*. | 5 // Note: This file also tests child_process.*. |
6 | 6 |
7 #include "services/service_manager/runner/host/child_process_host.h" | 7 #include "services/service_manager/runner/host/child_process_host.h" |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <utility> | 10 #include <utility> |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "mojo/edk/embedder/process_delegate.h" | 22 #include "mojo/edk/embedder/process_delegate.h" |
23 #include "services/service_manager/native_runner_delegate.h" | 23 #include "services/service_manager/native_runner_delegate.h" |
24 #include "testing/gtest/include/gtest/gtest.h" | 24 #include "testing/gtest/include/gtest/gtest.h" |
25 | 25 |
26 namespace service_manager { | 26 namespace service_manager { |
27 namespace { | 27 namespace { |
28 | 28 |
29 const char kTestServiceName[] = "host_test_service"; | 29 const char kTestServiceName[] = "host_test_service"; |
30 | 30 |
31 const base::FilePath::CharType kPackagesPath[] = FILE_PATH_LITERAL("Packages"); | 31 const base::FilePath::CharType kPackagesPath[] = FILE_PATH_LITERAL("Packages"); |
| 32 |
| 33 #if defined(OS_WIN) |
| 34 const base::FilePath::CharType kServiceExtension[] = |
| 35 FILE_PATH_LITERAL(".service.exe"); |
| 36 #else |
32 const base::FilePath::CharType kServiceExtension[] = | 37 const base::FilePath::CharType kServiceExtension[] = |
33 FILE_PATH_LITERAL(".service"); | 38 FILE_PATH_LITERAL(".service"); |
| 39 #endif |
34 | 40 |
35 void ProcessReadyCallbackAdapater(const base::Closure& callback, | 41 void ProcessReadyCallbackAdapater(const base::Closure& callback, |
36 base::ProcessId process_id) { | 42 base::ProcessId process_id) { |
37 callback.Run(); | 43 callback.Run(); |
38 } | 44 } |
39 | 45 |
40 class ProcessDelegate : public mojo::edk::ProcessDelegate { | 46 class ProcessDelegate : public mojo::edk::ProcessDelegate { |
41 public: | 47 public: |
42 ProcessDelegate() {} | 48 ProcessDelegate() {} |
43 ~ProcessDelegate() override {} | 49 ~ProcessDelegate() override {} |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 run_loop.Run(); | 115 run_loop.Run(); |
110 | 116 |
111 child_process_host.Join(); | 117 child_process_host.Join(); |
112 blocking_pool->Shutdown(); | 118 blocking_pool->Shutdown(); |
113 mojo::edk::ShutdownIPCSupport(); | 119 mojo::edk::ShutdownIPCSupport(); |
114 EXPECT_EQ(1u, native_runner_delegate.get_and_clear_adjust_count()); | 120 EXPECT_EQ(1u, native_runner_delegate.get_and_clear_adjust_count()); |
115 } | 121 } |
116 | 122 |
117 } // namespace | 123 } // namespace |
118 } // namespace service_manager | 124 } // namespace service_manager |
OLD | NEW |