Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/shell/app/shell_main_delegate.h" | 5 #include "content/shell/app/shell_main_delegate.h" |
| 6 | 6 |
| 7 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/cpu.h" | 9 #include "base/cpu.h" |
| 10 #include "base/files/file.h" | 10 #include "base/files/file.h" |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 206 command_line.AppendSwitchASCII(switches::kHostResolverRules, | 206 command_line.AppendSwitchASCII(switches::kHostResolverRules, |
| 207 "MAP *.test 127.0.0.1"); | 207 "MAP *.test 127.0.0.1"); |
| 208 | 208 |
| 209 command_line.AppendSwitch(switches::kEnablePartialRaster); | 209 command_line.AppendSwitch(switches::kEnablePartialRaster); |
| 210 | 210 |
| 211 if (!command_line.HasSwitch(switches::kForceGpuRasterization) && | 211 if (!command_line.HasSwitch(switches::kForceGpuRasterization) && |
| 212 !command_line.HasSwitch(switches::kEnableGpuRasterization)) { | 212 !command_line.HasSwitch(switches::kEnableGpuRasterization)) { |
| 213 command_line.AppendSwitch(switches::kDisableGpuRasterization); | 213 command_line.AppendSwitch(switches::kDisableGpuRasterization); |
| 214 } | 214 } |
| 215 | 215 |
| 216 // Enable color correct rendering. If the virtual test suite didn't specify | 216 // If the virtual test suite didn't specify a color space, then force sRGB. |
| 217 // a color space, then use sRGB. | |
| 218 command_line.AppendSwitch(switches::kEnableColorCorrectRendering); | |
| 219 if (!command_line.HasSwitch(switches::kForceColorProfile)) | 217 if (!command_line.HasSwitch(switches::kForceColorProfile)) |
| 220 command_line.AppendSwitchASCII(switches::kForceColorProfile, "srgb"); | 218 command_line.AppendSwitchASCII(switches::kForceColorProfile, "srgb"); |
| 221 | 219 |
| 222 // We want stable/baseline results when running layout tests. | 220 // We want stable/baseline results when running layout tests. |
| 223 command_line.AppendSwitch(switches::kDisableSkiaRuntimeOpts); | 221 command_line.AppendSwitch(switches::kDisableSkiaRuntimeOpts); |
| 224 | 222 |
| 225 command_line.AppendSwitch(cc::switches::kDisallowNonExactResourceReuse); | 223 command_line.AppendSwitch(cc::switches::kDisallowNonExactResourceReuse); |
| 226 | 224 |
| 227 // Unless/until WebM files are added to the media layout tests, we need to | 225 // Unless/until WebM files are added to the media layout tests, we need to |
| 228 // avoid removing MP4/H264/AAC so that layout tests can run on Android. | 226 // avoid removing MP4/H264/AAC so that layout tests can run on Android. |
| 229 #if !defined(OS_ANDROID) | 227 #if !defined(OS_ANDROID) |
| 230 media::RemoveProprietaryMediaTypesAndCodecsForTests(); | 228 media::RemoveProprietaryMediaTypesAndCodecsForTests(); |
| 231 #endif | 229 #endif |
| 232 | 230 |
| 233 if (!BlinkTestPlatformInitialize()) { | 231 if (!BlinkTestPlatformInitialize()) { |
| 234 *exit_code = 1; | 232 *exit_code = 1; |
| 235 return true; | 233 return true; |
| 236 } | 234 } |
| 237 } | 235 } |
| 238 | 236 |
|
ccameron
2017/06/15 20:23:55
This is doing what was explicitly not supposed to
Alexei Svitkine (slow)
2017/06/15 21:04:40
(Just trying to understand.)
Is the goal to enabl
ccameron
2017/06/15 21:26:25
(related oops -- this was supposed to be in the "i
| |
| 237 // Enable additional base::Features. Note that there already may exist a list | |
| 238 // of enabled features from the virtual or physical test suite. | |
| 239 std::string enabled_features = | |
| 240 command_line.GetSwitchValueASCII(switches::kEnableFeatures); | |
| 241 enabled_features = "ColorCorrectRendering," + enabled_features; | |
| 242 command_line.AppendSwitchASCII(switches::kEnableFeatures, enabled_features); | |
| 243 | |
| 239 content_client_.reset(base::CommandLine::ForCurrentProcess()->HasSwitch( | 244 content_client_.reset(base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 240 switches::kRunLayoutTest) | 245 switches::kRunLayoutTest) |
| 241 ? new LayoutTestContentClient | 246 ? new LayoutTestContentClient |
| 242 : new ShellContentClient); | 247 : new ShellContentClient); |
| 243 SetContentClient(content_client_.get()); | 248 SetContentClient(content_client_.get()); |
| 244 | 249 |
| 245 return false; | 250 return false; |
| 246 } | 251 } |
| 247 | 252 |
| 248 void ShellMainDelegate::PreSandboxStartup() { | 253 void ShellMainDelegate::PreSandboxStartup() { |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 381 | 386 |
| 382 return renderer_client_.get(); | 387 return renderer_client_.get(); |
| 383 } | 388 } |
| 384 | 389 |
| 385 ContentUtilityClient* ShellMainDelegate::CreateContentUtilityClient() { | 390 ContentUtilityClient* ShellMainDelegate::CreateContentUtilityClient() { |
| 386 utility_client_.reset(new ShellContentUtilityClient); | 391 utility_client_.reset(new ShellContentUtilityClient); |
| 387 return utility_client_.get(); | 392 return utility_client_.get(); |
| 388 } | 393 } |
| 389 | 394 |
| 390 } // namespace content | 395 } // namespace content |
| OLD | NEW |