OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/edk/test/multiprocess_test_helper.h" | 5 #include "mojo/edk/test/multiprocess_test_helper.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/posix/global_descriptors.h" | 9 #include "base/posix/global_descriptors.h" |
10 #include "base/test/test_timeouts.h" | 10 #include "base/test/test_timeouts.h" |
11 #include "mojo/edk/embedder/platform_channel_pair.h" | |
12 #include "mojo/edk/platform/platform_handle.h" | 11 #include "mojo/edk/platform/platform_handle.h" |
| 12 #include "mojo/edk/platform/platform_pipe.h" |
13 #include "mojo/edk/platform/scoped_platform_handle.h" | 13 #include "mojo/edk/platform/scoped_platform_handle.h" |
14 | 14 |
15 using mojo::platform::PlatformHandle; | 15 using mojo::platform::PlatformHandle; |
| 16 using mojo::platform::PlatformPipe; |
16 using mojo::platform::ScopedPlatformHandle; | 17 using mojo::platform::ScopedPlatformHandle; |
17 | 18 |
18 namespace mojo { | 19 namespace mojo { |
19 namespace test { | 20 namespace test { |
20 | 21 |
21 MultiprocessTestHelper::MultiprocessTestHelper() | 22 MultiprocessTestHelper::MultiprocessTestHelper() |
22 : platform_channel_pair_(new embedder::PlatformChannelPair()) { | 23 : platform_channel_pair_(new PlatformPipe()) { |
23 server_platform_handle = platform_channel_pair_->handle0.Pass(); | 24 server_platform_handle = platform_channel_pair_->handle0.Pass(); |
24 } | 25 } |
25 | 26 |
26 MultiprocessTestHelper::~MultiprocessTestHelper() { | 27 MultiprocessTestHelper::~MultiprocessTestHelper() { |
27 CHECK(!test_child_.IsValid()); | 28 CHECK(!test_child_.IsValid()); |
28 server_platform_handle.reset(); | 29 server_platform_handle.reset(); |
29 platform_channel_pair_.reset(); | 30 platform_channel_pair_.reset(); |
30 } | 31 } |
31 | 32 |
32 void MultiprocessTestHelper::StartChild(const std::string& test_child_name) { | 33 void MultiprocessTestHelper::StartChild(const std::string& test_child_name) { |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 CHECK(base::CommandLine::InitializedForCurrentProcess()); | 87 CHECK(base::CommandLine::InitializedForCurrentProcess()); |
87 client_platform_handle = ScopedPlatformHandle( | 88 client_platform_handle = ScopedPlatformHandle( |
88 PlatformHandle(base::GlobalDescriptors::kBaseDescriptor)); | 89 PlatformHandle(base::GlobalDescriptors::kBaseDescriptor)); |
89 } | 90 } |
90 | 91 |
91 // static | 92 // static |
92 ScopedPlatformHandle MultiprocessTestHelper::client_platform_handle; | 93 ScopedPlatformHandle MultiprocessTestHelper::client_platform_handle; |
93 | 94 |
94 } // namespace test | 95 } // namespace test |
95 } // namespace mojo | 96 } // namespace mojo |
OLD | NEW |