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

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

Issue 2557213002: Build services as standalone executables (Closed)
Patch Set: remove DCHECKs with side effects -_- Created 4 years 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
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 "chrome/test/base/mojo_test_connector.h" 5 #include "chrome/test/base/mojo_test_connector.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 public: 207 public:
208 NativeRunnerDelegateImpl() {} 208 NativeRunnerDelegateImpl() {}
209 ~NativeRunnerDelegateImpl() override {} 209 ~NativeRunnerDelegateImpl() override {}
210 210
211 private: 211 private:
212 // service_manager::NativeRunnerDelegate: 212 // service_manager::NativeRunnerDelegate:
213 void AdjustCommandLineArgumentsForTarget( 213 void AdjustCommandLineArgumentsForTarget(
214 const service_manager::Identity& target, 214 const service_manager::Identity& target,
215 base::CommandLine* command_line) override { 215 base::CommandLine* command_line) override {
216 if (target.name() != kTestName) { 216 if (target.name() != kTestName) {
217 if (target.name() == kTestRunnerName) 217 if (target.name() == kTestRunnerName) {
218 RemoveMashFromBrowserTests(command_line); 218 RemoveMashFromBrowserTests(command_line);
219 command_line->SetProgram(
220 base::CommandLine::ForCurrentProcess()->GetProgram());
221 }
219 command_line->AppendSwitch(MojoTestConnector::kMashApp); 222 command_line->AppendSwitch(MojoTestConnector::kMashApp);
220 return; 223 return;
221 } 224 }
222 225
223 base::CommandLine::StringVector argv(command_line->argv()); 226 base::CommandLine::StringVector argv(command_line->argv());
224 auto iter = 227 auto iter =
225 std::find(argv.begin(), argv.end(), FILE_PATH_LITERAL("--run-in-mash")); 228 std::find(argv.begin(), argv.end(), FILE_PATH_LITERAL("--run-in-mash"));
226 if (iter != argv.end()) 229 if (iter != argv.end())
227 argv.erase(iter); 230 argv.erase(iter);
228 *command_line = base::CommandLine(argv); 231 *command_line = base::CommandLine(argv);
(...skipping 25 matching lines...) Expand all
254 MojoTestConnector::~MojoTestConnector() {} 257 MojoTestConnector::~MojoTestConnector() {}
255 258
256 std::unique_ptr<content::TestState> MojoTestConnector::PrepareForTest( 259 std::unique_ptr<content::TestState> MojoTestConnector::PrepareForTest(
257 base::CommandLine* command_line, 260 base::CommandLine* command_line,
258 base::TestLauncher::LaunchOptions* test_launch_options) { 261 base::TestLauncher::LaunchOptions* test_launch_options) {
259 std::unique_ptr<MojoTestState> test_state( 262 std::unique_ptr<MojoTestState> test_state(
260 new MojoTestState(&background_service_manager_)); 263 new MojoTestState(&background_service_manager_));
261 test_state->Init(command_line, test_launch_options); 264 test_state->Init(command_line, test_launch_options);
262 return std::move(test_state); 265 return std::move(test_state);
263 } 266 }
OLDNEW
« no previous file with comments | « chrome/test/base/mash_browser_tests_main.cc ('k') | content/browser/service_manager/service_manager_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698