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 "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 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 | 208 |
209 private: | 209 private: |
210 // shell::NativeRunnerDelegate: | 210 // shell::NativeRunnerDelegate: |
211 void AdjustCommandLineArgumentsForTarget( | 211 void AdjustCommandLineArgumentsForTarget( |
212 const shell::Identity& target, | 212 const shell::Identity& target, |
213 base::CommandLine* command_line) override { | 213 base::CommandLine* command_line) override { |
214 if (target.name() != "exe:chrome") { | 214 if (target.name() != "exe:chrome") { |
215 if (target.name() == "exe:mash_browser_tests") | 215 if (target.name() == "exe:mash_browser_tests") |
216 RemoveMashFromBrowserTests(command_line); | 216 RemoveMashFromBrowserTests(command_line); |
217 command_line->AppendSwitch(MojoTestConnector::kMashApp); | 217 command_line->AppendSwitch(MojoTestConnector::kMashApp); |
218 if (target.instance() == "font_service" || target.instance() == "ui") { | |
219 base::CommandLine::StringVector argv(command_line->argv()); | |
220 auto iter = std::find(argv.begin(), argv.end(), | |
221 FILE_PATH_LITERAL("--enable-sandbox")); | |
222 if (iter != argv.end()) | |
223 argv.erase(iter); | |
224 *command_line = base::CommandLine(argv); | |
225 } | |
226 return; | 218 return; |
227 } | 219 } |
228 | 220 |
229 base::CommandLine::StringVector argv(command_line->argv()); | 221 base::CommandLine::StringVector argv(command_line->argv()); |
230 auto iter = | 222 auto iter = |
231 std::find(argv.begin(), argv.end(), FILE_PATH_LITERAL("--run-in-mash")); | 223 std::find(argv.begin(), argv.end(), FILE_PATH_LITERAL("--run-in-mash")); |
232 if (iter != argv.end()) | 224 if (iter != argv.end()) |
233 argv.erase(iter); | 225 argv.erase(iter); |
234 *command_line = base::CommandLine(argv); | 226 *command_line = base::CommandLine(argv); |
235 } | 227 } |
(...skipping 24 matching lines...) Expand all Loading... |
260 MojoTestConnector::~MojoTestConnector() {} | 252 MojoTestConnector::~MojoTestConnector() {} |
261 | 253 |
262 std::unique_ptr<content::TestState> MojoTestConnector::PrepareForTest( | 254 std::unique_ptr<content::TestState> MojoTestConnector::PrepareForTest( |
263 base::CommandLine* command_line, | 255 base::CommandLine* command_line, |
264 base::TestLauncher::LaunchOptions* test_launch_options) { | 256 base::TestLauncher::LaunchOptions* test_launch_options) { |
265 std::unique_ptr<MojoTestState> test_state( | 257 std::unique_ptr<MojoTestState> test_state( |
266 new MojoTestState(&background_shell_)); | 258 new MojoTestState(&background_shell_)); |
267 test_state->Init(command_line, test_launch_options); | 259 test_state->Init(command_line, test_launch_options); |
268 return std::move(test_state); | 260 return std::move(test_state); |
269 } | 261 } |
OLD | NEW |