| 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 "base/base_paths.h" | 5 #include "base/base_paths.h" |
| 6 #include "base/base_switches.h" | 6 #include "base/base_switches.h" |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 filter->filter.insert("*", std::move(test_interfaces)); | 211 filter->filter.insert("*", std::move(test_interfaces)); |
| 212 | 212 |
| 213 mojo::shell::mojom::ShellPtr shell; | 213 mojo::shell::mojom::ShellPtr shell; |
| 214 connector()->ConnectToInterface("mojo:shell", &shell); | 214 connector()->ConnectToInterface("mojo:shell", &shell); |
| 215 | 215 |
| 216 mojo::shell::mojom::ShellClientFactoryPtr factory; | 216 mojo::shell::mojom::ShellClientFactoryPtr factory; |
| 217 factory.Bind(mojo::InterfacePtrInfo<mojo::shell::mojom::ShellClientFactory>( | 217 factory.Bind(mojo::InterfacePtrInfo<mojo::shell::mojom::ShellClientFactory>( |
| 218 std::move(pipe), 0u)); | 218 std::move(pipe), 0u)); |
| 219 | 219 |
| 220 shell->CreateInstanceForFactory(std::move(factory), kTestExeName, | 220 shell->CreateInstanceForFactory(std::move(factory), kTestExeName, |
| 221 mojom::Connector::kUserInherit, | 221 mojom::kInheritUserID, std::move(filter), |
| 222 std::move(filter), std::move(request)); | 222 std::move(request)); |
| 223 | 223 |
| 224 base::LaunchOptions options; | 224 base::LaunchOptions options; |
| 225 #if defined(OS_WIN) | 225 #if defined(OS_WIN) |
| 226 options.handles_to_inherit = &handle_passing_info; | 226 options.handles_to_inherit = &handle_passing_info; |
| 227 #elif defined(OS_POSIX) | 227 #elif defined(OS_POSIX) |
| 228 options.fds_to_remap = &handle_passing_info; | 228 options.fds_to_remap = &handle_passing_info; |
| 229 #endif | 229 #endif |
| 230 base::Process process = base::LaunchProcess(child_command_line, options); | 230 base::Process process = base::LaunchProcess(child_command_line, options); |
| 231 DCHECK(process.IsValid()); | 231 DCHECK(process.IsValid()); |
| 232 receiver->SetPID(process.Pid()); | 232 receiver->SetPID(process.Pid()); |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 loop.Run(); | 498 loop.Run(); |
| 499 | 499 |
| 500 WaitForInstanceDestruction(); | 500 WaitForInstanceDestruction(); |
| 501 EXPECT_FALSE(instances()->HasInstanceForName(kTestExeName)); | 501 EXPECT_FALSE(instances()->HasInstanceForName(kTestExeName)); |
| 502 EXPECT_EQ(0u, instances()->GetNewInstanceCount()); | 502 EXPECT_EQ(0u, instances()->GetNewInstanceCount()); |
| 503 } | 503 } |
| 504 | 504 |
| 505 | 505 |
| 506 } // namespace shell | 506 } // namespace shell |
| 507 } // namespace mojo | 507 } // namespace mojo |
| OLD | NEW |