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 } |
218 return; | 226 return; |
219 } | 227 } |
220 | 228 |
221 base::CommandLine::StringVector argv(command_line->argv()); | 229 base::CommandLine::StringVector argv(command_line->argv()); |
222 auto iter = | 230 auto iter = |
223 std::find(argv.begin(), argv.end(), FILE_PATH_LITERAL("--run-in-mash")); | 231 std::find(argv.begin(), argv.end(), FILE_PATH_LITERAL("--run-in-mash")); |
224 if (iter != argv.end()) | 232 if (iter != argv.end()) |
225 argv.erase(iter); | 233 argv.erase(iter); |
226 *command_line = base::CommandLine(argv); | 234 *command_line = base::CommandLine(argv); |
227 } | 235 } |
(...skipping 24 matching lines...) Expand all Loading... |
252 MojoTestConnector::~MojoTestConnector() {} | 260 MojoTestConnector::~MojoTestConnector() {} |
253 | 261 |
254 std::unique_ptr<content::TestState> MojoTestConnector::PrepareForTest( | 262 std::unique_ptr<content::TestState> MojoTestConnector::PrepareForTest( |
255 base::CommandLine* command_line, | 263 base::CommandLine* command_line, |
256 base::TestLauncher::LaunchOptions* test_launch_options) { | 264 base::TestLauncher::LaunchOptions* test_launch_options) { |
257 std::unique_ptr<MojoTestState> test_state( | 265 std::unique_ptr<MojoTestState> test_state( |
258 new MojoTestState(&background_shell_)); | 266 new MojoTestState(&background_shell_)); |
259 test_state->Init(command_line, test_launch_options); | 267 test_state->Init(command_line, test_launch_options); |
260 return std::move(test_state); | 268 return std::move(test_state); |
261 } | 269 } |
OLD | NEW |