| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <stdint.h> | 5 #include <stdint.h> |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/at_exit.h" | 9 #include "base/at_exit.h" |
| 10 #include "base/base_paths.h" | 10 #include "base/base_paths.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 mojo::edk::CreateParentMessagePipe(primordial_pipe_token); | 85 mojo::edk::CreateParentMessagePipe(primordial_pipe_token); |
| 86 | 86 |
| 87 mojo::shell::mojom::CapabilityFilterPtr filter( | 87 mojo::shell::mojom::CapabilityFilterPtr filter( |
| 88 mojo::shell::mojom::CapabilityFilter::New()); | 88 mojo::shell::mojom::CapabilityFilter::New()); |
| 89 mojo::Array<mojo::String> test_interfaces; | 89 mojo::Array<mojo::String> test_interfaces; |
| 90 test_interfaces.push_back( | 90 test_interfaces.push_back( |
| 91 mojo::shell::test::mojom::CreateInstanceForHandleTest::Name_); | 91 mojo::shell::test::mojom::CreateInstanceForHandleTest::Name_); |
| 92 filter->filter.insert("mojo:application_manager_unittest", | 92 filter->filter.insert("mojo:application_manager_unittest", |
| 93 std::move(test_interfaces)); | 93 std::move(test_interfaces)); |
| 94 | 94 |
| 95 mojo::shell::mojom::ShellClientFactoryPtr factory; |
| 96 factory.Bind(mojo::InterfacePtrInfo<mojo::shell::mojom::ShellClientFactory>( |
| 97 std::move(pipe), 0u)); |
| 98 |
| 95 mojo::shell::mojom::ApplicationManagerPtr application_manager; | 99 mojo::shell::mojom::ApplicationManagerPtr application_manager; |
| 96 connector->ConnectToInterface("mojo:shell", &application_manager); | 100 connector->ConnectToInterface("mojo:shell", &application_manager); |
| 97 application_manager->CreateInstanceForHandle( | 101 application_manager->CreateInstanceForFactory( |
| 98 mojo::ScopedHandle(mojo::Handle(pipe.release().value())), | 102 std::move(factory), "exe:application_manager_unittest_target", |
| 99 "exe:application_manager_unittest_target", std::move(filter), | 103 std::move(filter), std::move(request)); |
| 100 std::move(request)); | |
| 101 | 104 |
| 102 base::LaunchOptions options; | 105 base::LaunchOptions options; |
| 103 #if defined(OS_WIN) | 106 #if defined(OS_WIN) |
| 104 options.handles_to_inherit = &handle_passing_info; | 107 options.handles_to_inherit = &handle_passing_info; |
| 105 #elif defined(OS_POSIX) | 108 #elif defined(OS_POSIX) |
| 106 options.fds_to_remap = &handle_passing_info; | 109 options.fds_to_remap = &handle_passing_info; |
| 107 #endif | 110 #endif |
| 108 target_ = base::LaunchProcess(child_command_line, options); | 111 target_ = base::LaunchProcess(child_command_line, options); |
| 109 DCHECK(target_.IsValid()); | 112 DCHECK(target_.IsValid()); |
| 110 receiver->SetPID(target_.Pid()); | 113 receiver->SetPID(target_.Pid()); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 140 | 143 |
| 141 int main(int argc, char** argv) { | 144 int main(int argc, char** argv) { |
| 142 base::AtExitManager at_exit; | 145 base::AtExitManager at_exit; |
| 143 base::CommandLine::Init(argc, argv); | 146 base::CommandLine::Init(argc, argv); |
| 144 | 147 |
| 145 mojo::shell::InitializeLogging(); | 148 mojo::shell::InitializeLogging(); |
| 146 | 149 |
| 147 Driver driver; | 150 Driver driver; |
| 148 return mojo::shell::TestNativeMain(&driver); | 151 return mojo::shell::TestNativeMain(&driver); |
| 149 } | 152 } |
| OLD | NEW |