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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 mojo::ScopedMessagePipeHandle pipe) { | 143 mojo::ScopedMessagePipeHandle pipe) { |
144 mojo::shell::mojom::CapabilityFilterPtr filter( | 144 mojo::shell::mojom::CapabilityFilterPtr filter( |
145 mojo::shell::mojom::CapabilityFilter::New()); | 145 mojo::shell::mojom::CapabilityFilter::New()); |
146 mojo::Array<mojo::String> test_interfaces; | 146 mojo::Array<mojo::String> test_interfaces; |
147 test_interfaces.push_back( | 147 test_interfaces.push_back( |
148 mojo::shell::test::mojom::CreateInstanceForHandleTest::Name_); | 148 mojo::shell::test::mojom::CreateInstanceForHandleTest::Name_); |
149 filter->filter.insert("mojo:mojo_shell_apptests", | 149 filter->filter.insert("mojo:mojo_shell_apptests", |
150 std::move(test_interfaces)); | 150 std::move(test_interfaces)); |
151 | 151 |
152 mojo::shell::mojom::ApplicationManagerPtr application_manager; | 152 mojo::shell::mojom::ApplicationManagerPtr application_manager; |
153 shell_->ConnectToService("mojo:shell", &application_manager); | 153 shell_->ConnectToInterface("mojo:shell", &application_manager); |
154 application_manager->CreateInstanceForHandle( | 154 application_manager->CreateInstanceForHandle( |
155 mojo::ScopedHandle(mojo::Handle(pipe.release().value())), | 155 mojo::ScopedHandle(mojo::Handle(pipe.release().value())), |
156 "exe:application_manager_apptest_target", std::move(filter), | 156 "exe:application_manager_apptest_target", std::move(filter), |
157 std::move(request)); | 157 std::move(request)); |
158 } | 158 } |
159 | 159 |
160 mojo::Shell* shell_; | 160 mojo::Shell* shell_; |
161 base::Process target_; | 161 base::Process target_; |
162 mojo::WeakBindingSet<Driver> bindings_; | 162 mojo::WeakBindingSet<Driver> bindings_; |
163 base::WeakPtrFactory<TargetApplicationDelegate> weak_factory_; | 163 base::WeakPtrFactory<TargetApplicationDelegate> weak_factory_; |
164 | 164 |
165 DISALLOW_COPY_AND_ASSIGN(TargetApplicationDelegate); | 165 DISALLOW_COPY_AND_ASSIGN(TargetApplicationDelegate); |
166 }; | 166 }; |
167 | 167 |
168 } // namespace | 168 } // namespace |
169 | 169 |
170 int main(int argc, char** argv) { | 170 int main(int argc, char** argv) { |
171 base::AtExitManager at_exit; | 171 base::AtExitManager at_exit; |
172 base::CommandLine::Init(argc, argv); | 172 base::CommandLine::Init(argc, argv); |
173 | 173 |
174 mojo::shell::InitializeLogging(); | 174 mojo::shell::InitializeLogging(); |
175 | 175 |
176 TargetApplicationDelegate delegate; | 176 TargetApplicationDelegate delegate; |
177 return mojo::shell::TestNativeMain(&delegate); | 177 return mojo::shell::TestNativeMain(&delegate); |
178 } | 178 } |
OLD | NEW |