Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1769)

Side by Side Diff: chrome/test/base/mash_browser_tests_main.cc

Issue 2138263002: Revert of Move content's shell connections to the IO thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/chromeos/chrome_interface_factory.cc ('k') | content/browser/browser_context.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
11 #include "base/process/launch.h" 11 #include "base/process/launch.h"
12 #include "base/sys_info.h" 12 #include "base/sys_info.h"
13 #include "base/threading/thread_task_runner_handle.h"
14 #include "chrome/test/base/chrome_test_launcher.h" 13 #include "chrome/test/base/chrome_test_launcher.h"
15 #include "chrome/test/base/chrome_test_suite.h" 14 #include "chrome/test/base/chrome_test_suite.h"
16 #include "chrome/test/base/mojo_test_connector.h" 15 #include "chrome/test/base/mojo_test_connector.h"
17 #include "content/public/common/mojo_shell_connection.h" 16 #include "content/public/common/mojo_shell_connection.h"
18 #include "content/public/test/test_launcher.h" 17 #include "content/public/test/test_launcher.h"
19 #include "services/shell/public/cpp/connector.h" 18 #include "services/shell/public/cpp/connector.h"
20 #include "services/shell/public/cpp/service.h" 19 #include "services/shell/public/cpp/service.h"
21 #include "services/shell/public/cpp/service_context.h" 20 #include "services/shell/public/cpp/service_context.h"
22 #include "services/shell/runner/common/switches.h" 21 #include "services/shell/runner/common/switches.h"
23 #include "services/shell/runner/host/child_process.h" 22 #include "services/shell/runner/host/child_process.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 std::unique_ptr<shell::Service> service_; 101 std::unique_ptr<shell::Service> service_;
103 std::unique_ptr<shell::ServiceContext> shell_connection_; 102 std::unique_ptr<shell::ServiceContext> shell_connection_;
104 103
105 DISALLOW_COPY_AND_ASSIGN(MashTestLauncherDelegate); 104 DISALLOW_COPY_AND_ASSIGN(MashTestLauncherDelegate);
106 }; 105 };
107 106
108 std::unique_ptr<content::MojoShellConnection> CreateMojoShellConnection( 107 std::unique_ptr<content::MojoShellConnection> CreateMojoShellConnection(
109 MashTestLauncherDelegate* delegate) { 108 MashTestLauncherDelegate* delegate) {
110 std::unique_ptr<content::MojoShellConnection> connection( 109 std::unique_ptr<content::MojoShellConnection> connection(
111 content::MojoShellConnection::Create( 110 content::MojoShellConnection::Create(
112 delegate->GetMojoTestConnectorForSingleProcess()->Init(), 111 delegate->GetMojoTestConnectorForSingleProcess()->Init()));
113 base::ThreadTaskRunnerHandle::Get()));
114 connection->Start();
115 ConnectToDefaultApps(connection->GetConnector()); 112 ConnectToDefaultApps(connection->GetConnector());
116 return connection; 113 return connection;
117 } 114 }
118 115
119 } // namespace 116 } // namespace
120 117
121 bool RunMashBrowserTests(int argc, char** argv, int* exit_code) { 118 bool RunMashBrowserTests(int argc, char** argv, int* exit_code) {
122 base::CommandLine::Init(argc, argv); 119 base::CommandLine::Init(argc, argv);
123 const base::CommandLine& command_line = 120 const base::CommandLine& command_line =
124 *base::CommandLine::ForCurrentProcess(); 121 *base::CommandLine::ForCurrentProcess();
(...skipping 26 matching lines...) Expand all
151 !command_line.HasSwitch(switches::kPrimordialPipeToken)) { 148 !command_line.HasSwitch(switches::kPrimordialPipeToken)) {
152 shell_connection_factory = 149 shell_connection_factory =
153 base::Bind(&CreateMojoShellConnection, &delegate); 150 base::Bind(&CreateMojoShellConnection, &delegate);
154 content::MojoShellConnection::SetFactoryForTest(&shell_connection_factory); 151 content::MojoShellConnection::SetFactoryForTest(&shell_connection_factory);
155 } 152 }
156 *exit_code = LaunchChromeTests(default_jobs, &delegate, argc, argv); 153 *exit_code = LaunchChromeTests(default_jobs, &delegate, argc, argv);
157 // TODO(sky): nuke once resolve why test isn't shutting down: 594600. 154 // TODO(sky): nuke once resolve why test isn't shutting down: 594600.
158 LOG(ERROR) << "RunMashBrowserTests exit_code=" << *exit_code; 155 LOG(ERROR) << "RunMashBrowserTests exit_code=" << *exit_code;
159 return true; 156 return true;
160 } 157 }
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/chrome_interface_factory.cc ('k') | content/browser/browser_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698