| 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 <algorithm> | 5 #include <algorithm> |
| 6 | 6 |
| 7 #include "base/at_exit.h" | 7 #include "base/at_exit.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/debug/debugger.h" | 9 #include "base/debug/debugger.h" |
| 10 #include "base/debug/stack_trace.h" | 10 #include "base/debug/stack_trace.h" |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 } | 155 } |
| 156 | 156 |
| 157 void StartChildApp(service_manager::mojom::ServiceRequest service_request) { | 157 void StartChildApp(service_manager::mojom::ServiceRequest service_request) { |
| 158 // The UI service requires this to be TYPE_UI. We don't know which service | 158 // The UI service requires this to be TYPE_UI. We don't know which service |
| 159 // we're going to run yet, so we just always use TYPE_UI for now. | 159 // we're going to run yet, so we just always use TYPE_UI for now. |
| 160 base::MessageLoop message_loop(base::MessageLoop::TYPE_UI); | 160 base::MessageLoop message_loop(base::MessageLoop::TYPE_UI); |
| 161 base::RunLoop run_loop; | 161 base::RunLoop run_loop; |
| 162 service_manager::ServiceContext context( | 162 service_manager::ServiceContext context( |
| 163 base::MakeUnique<mash::MashPackagedService>(), | 163 base::MakeUnique<mash::MashPackagedService>(), |
| 164 std::move(service_request)); | 164 std::move(service_request)); |
| 165 context.SetConnectionLostClosure(run_loop.QuitClosure()); | 165 context.SetQuitClosure(run_loop.QuitClosure()); |
| 166 run_loop.Run(); | 166 run_loop.Run(); |
| 167 } | 167 } |
| 168 | 168 |
| 169 } // namespace | 169 } // namespace |
| 170 | 170 |
| 171 bool RunMashBrowserTests(int argc, char** argv, int* exit_code) { | 171 bool RunMashBrowserTests(int argc, char** argv, int* exit_code) { |
| 172 base::CommandLine::Init(argc, argv); | 172 base::CommandLine::Init(argc, argv); |
| 173 const base::CommandLine& command_line = | 173 const base::CommandLine& command_line = |
| 174 *base::CommandLine::ForCurrentProcess(); | 174 *base::CommandLine::ForCurrentProcess(); |
| 175 if (!command_line.HasSwitch("run-in-mash")) | 175 if (!command_line.HasSwitch("run-in-mash")) |
| (...skipping 24 matching lines...) Expand all Loading... |
| 200 if (command_line.HasSwitch(content::kSingleProcessTestsFlag) && | 200 if (command_line.HasSwitch(content::kSingleProcessTestsFlag) && |
| 201 !command_line.HasSwitch(switches::kPrimordialPipeToken)) { | 201 !command_line.HasSwitch(switches::kPrimordialPipeToken)) { |
| 202 service_manager_connection_factory = | 202 service_manager_connection_factory = |
| 203 base::Bind(&CreateServiceManagerConnection, &delegate); | 203 base::Bind(&CreateServiceManagerConnection, &delegate); |
| 204 content::ServiceManagerConnection::SetFactoryForTest( | 204 content::ServiceManagerConnection::SetFactoryForTest( |
| 205 &service_manager_connection_factory); | 205 &service_manager_connection_factory); |
| 206 } | 206 } |
| 207 *exit_code = LaunchChromeTests(default_jobs, &delegate, argc, argv); | 207 *exit_code = LaunchChromeTests(default_jobs, &delegate, argc, argv); |
| 208 return true; | 208 return true; |
| 209 } | 209 } |
| OLD | NEW |