| 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 <functional> | 7 #include <functional> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 launch_type == LaunchType::NAMED_CHILD) { | 153 launch_type == LaunchType::NAMED_CHILD) { |
| 154 std::string pipe_token; | 154 std::string pipe_token; |
| 155 pipe = process.CreateMessagePipe(&pipe_token); | 155 pipe = process.CreateMessagePipe(&pipe_token); |
| 156 command_line.AppendSwitchASCII(kMojoPrimordialPipeToken, pipe_token); | 156 command_line.AppendSwitchASCII(kMojoPrimordialPipeToken, pipe_token); |
| 157 } else if (launch_type == LaunchType::PEER || | 157 } else if (launch_type == LaunchType::PEER || |
| 158 launch_type == LaunchType::NAMED_PEER) { | 158 launch_type == LaunchType::NAMED_PEER) { |
| 159 peer_token_ = mojo::edk::GenerateRandomToken(); | 159 peer_token_ = mojo::edk::GenerateRandomToken(); |
| 160 pipe = ConnectToPeerProcess(std::move(server_handle), peer_token_); | 160 pipe = ConnectToPeerProcess(std::move(server_handle), peer_token_); |
| 161 } | 161 } |
| 162 | 162 |
| 163 test_child_ = | 163 base::SpawnChildResult result = |
| 164 base::SpawnMultiProcessTestChild(test_child_main, command_line, options); | 164 base::SpawnMultiProcessTestChild(test_child_main, command_line, options); |
| 165 test_child_ = std::move(result.process); |
| 165 if (launch_type == LaunchType::CHILD || launch_type == LaunchType::PEER) | 166 if (launch_type == LaunchType::CHILD || launch_type == LaunchType::PEER) |
| 166 channel.ChildProcessLaunched(); | 167 channel.ChildProcessLaunched(); |
| 167 | 168 |
| 168 if (launch_type == LaunchType::CHILD || | 169 if (launch_type == LaunchType::CHILD || |
| 169 launch_type == LaunchType::NAMED_CHILD) { | 170 launch_type == LaunchType::NAMED_CHILD) { |
| 170 DCHECK(server_handle.is_valid()); | 171 DCHECK(server_handle.is_valid()); |
| 171 process.Connect(test_child_.Handle(), std::move(server_handle), | 172 process.Connect(test_child_.Handle(), std::move(server_handle), |
| 172 process_error_callback_); | 173 process_error_callback_); |
| 173 } | 174 } |
| 174 | 175 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 ::testing::Test::HasNonfatalFailure()) ? 1 : 0; | 247 ::testing::Test::HasNonfatalFailure()) ? 1 : 0; |
| 247 }); | 248 }); |
| 248 } | 249 } |
| 249 | 250 |
| 250 // static | 251 // static |
| 251 mojo::ScopedMessagePipeHandle MultiprocessTestHelper::primordial_pipe; | 252 mojo::ScopedMessagePipeHandle MultiprocessTestHelper::primordial_pipe; |
| 252 | 253 |
| 253 } // namespace test | 254 } // namespace test |
| 254 } // namespace edk | 255 } // namespace edk |
| 255 } // namespace mojo | 256 } // namespace mojo |
| OLD | NEW |