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

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

Issue 2351603002: mojo: Use TYPE_DEFAULT message-loop for browser-tests. (Closed)
Patch Set: . Created 4 years, 3 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/app/mash/mash_runner.cc ('k') | services/shell/public/cpp/service_runner.h » ('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/i18n/icu_util.h" 10 #include "base/i18n/icu_util.h"
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 std::unique_ptr<content::MojoShellConnection> connection( 114 std::unique_ptr<content::MojoShellConnection> connection(
115 content::MojoShellConnection::Create( 115 content::MojoShellConnection::Create(
116 delegate->GetMojoTestConnectorForSingleProcess()->Init(), 116 delegate->GetMojoTestConnectorForSingleProcess()->Init(),
117 base::ThreadTaskRunnerHandle::Get())); 117 base::ThreadTaskRunnerHandle::Get()));
118 connection->Start(); 118 connection->Start();
119 ConnectToDefaultApps(connection->GetConnector()); 119 ConnectToDefaultApps(connection->GetConnector());
120 return connection; 120 return connection;
121 } 121 }
122 122
123 void StartChildApp(shell::mojom::ServiceRequest service_request) { 123 void StartChildApp(shell::mojom::ServiceRequest service_request) {
124 base::MessageLoop message_loop(base::MessageLoop::TYPE_UI); 124 base::MessageLoop message_loop(base::MessageLoop::TYPE_DEFAULT);
125 base::RunLoop run_loop; 125 base::RunLoop run_loop;
126 mash::MashPackagedService service; 126 mash::MashPackagedService service;
127 std::unique_ptr<shell::ServiceContext> context = 127 std::unique_ptr<shell::ServiceContext> context =
128 base::MakeUnique<shell::ServiceContext>(&service, 128 base::MakeUnique<shell::ServiceContext>(&service,
129 std::move(service_request)); 129 std::move(service_request));
130 context->SetConnectionLostClosure(run_loop.QuitClosure()); 130 context->SetConnectionLostClosure(run_loop.QuitClosure());
131 service.set_context(std::move(context)); 131 service.set_context(std::move(context));
132 run_loop.Run(); 132 run_loop.Run();
133 } 133 }
134 134
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 content::MojoShellConnection::Factory shell_connection_factory; 171 content::MojoShellConnection::Factory shell_connection_factory;
172 if (command_line.HasSwitch(content::kSingleProcessTestsFlag) && 172 if (command_line.HasSwitch(content::kSingleProcessTestsFlag) &&
173 !command_line.HasSwitch(switches::kPrimordialPipeToken)) { 173 !command_line.HasSwitch(switches::kPrimordialPipeToken)) {
174 shell_connection_factory = 174 shell_connection_factory =
175 base::Bind(&CreateMojoShellConnection, &delegate); 175 base::Bind(&CreateMojoShellConnection, &delegate);
176 content::MojoShellConnection::SetFactoryForTest(&shell_connection_factory); 176 content::MojoShellConnection::SetFactoryForTest(&shell_connection_factory);
177 } 177 }
178 *exit_code = LaunchChromeTests(default_jobs, &delegate, argc, argv); 178 *exit_code = LaunchChromeTests(default_jobs, &delegate, argc, argv);
179 return true; 179 return true;
180 } 180 }
OLDNEW
« no previous file with comments | « chrome/app/mash/mash_runner.cc ('k') | services/shell/public/cpp/service_runner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698