| 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" |
| 11 #include "base/files/file_path.h" | 11 #include "base/files/file_path.h" |
| 12 #include "base/lazy_instance.h" | 12 #include "base/lazy_instance.h" |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/path_service.h" | 14 #include "base/path_service.h" |
| 15 #include "cc/base/switches.h" | 15 #include "cc/base/switches.h" |
| 16 #include "content/public/browser/browser_main_runner.h" | 16 #include "content/public/browser/browser_main_runner.h" |
| 17 #include "content/public/common/content_switches.h" | 17 #include "content/public/common/content_switches.h" |
| 18 #include "content/public/common/url_constants.h" | 18 #include "content/public/common/url_constants.h" |
| 19 #include "content/public/test/layouttest_support.h" | 19 #include "content/public/test/layouttest_support.h" |
| 20 #include "content/shell/app/blink_test_platform_support.h" |
| 20 #include "content/shell/app/shell_crash_reporter_client.h" | 21 #include "content/shell/app/shell_crash_reporter_client.h" |
| 21 #include "content/shell/app/webkit_test_platform_support.h" | |
| 22 #include "content/shell/browser/layout_test/layout_test_browser_main.h" | 22 #include "content/shell/browser/layout_test/layout_test_browser_main.h" |
| 23 #include "content/shell/browser/shell_browser_main.h" | 23 #include "content/shell/browser/shell_browser_main.h" |
| 24 #include "content/shell/browser/shell_content_browser_client.h" | 24 #include "content/shell/browser/shell_content_browser_client.h" |
| 25 #include "content/shell/common/shell_switches.h" | 25 #include "content/shell/common/shell_switches.h" |
| 26 #include "content/shell/renderer/layout_test/layout_test_content_renderer_client
.h" | 26 #include "content/shell/renderer/layout_test/layout_test_content_renderer_client
.h" |
| 27 #include "content/shell/renderer/shell_content_renderer_client.h" | 27 #include "content/shell/renderer/shell_content_renderer_client.h" |
| 28 #include "media/base/media_switches.h" | 28 #include "media/base/media_switches.h" |
| 29 #include "net/cookies/cookie_monster.h" | 29 #include "net/cookies/cookie_monster.h" |
| 30 #include "ui/base/resource/resource_bundle.h" | 30 #include "ui/base/resource/resource_bundle.h" |
| 31 #include "ui/base/ui_base_paths.h" | 31 #include "ui/base/ui_base_paths.h" |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 | 114 |
| 115 bool ShellMainDelegate::BasicStartupComplete(int* exit_code) { | 115 bool ShellMainDelegate::BasicStartupComplete(int* exit_code) { |
| 116 #if defined(OS_WIN) | 116 #if defined(OS_WIN) |
| 117 // Enable trace control and transport through event tracing for Windows. | 117 // Enable trace control and transport through event tracing for Windows. |
| 118 logging::LogEventProvider::Initialize(kContentShellProviderName); | 118 logging::LogEventProvider::Initialize(kContentShellProviderName); |
| 119 | 119 |
| 120 v8_breakpad_support::SetUp(); | 120 v8_breakpad_support::SetUp(); |
| 121 #endif | 121 #endif |
| 122 #if defined(OS_MACOSX) | 122 #if defined(OS_MACOSX) |
| 123 // Needs to happen before InitializeResourceBundle() and before | 123 // Needs to happen before InitializeResourceBundle() and before |
| 124 // WebKitTestPlatformInitialize() are called. | 124 // BlinkTestPlatformInitialize() are called. |
| 125 OverrideFrameworkBundlePath(); | 125 OverrideFrameworkBundlePath(); |
| 126 OverrideChildProcessPath(); | 126 OverrideChildProcessPath(); |
| 127 EnsureCorrectResolutionSettings(); | 127 EnsureCorrectResolutionSettings(); |
| 128 #endif // OS_MACOSX | 128 #endif // OS_MACOSX |
| 129 | 129 |
| 130 InitLogging(); | 130 InitLogging(); |
| 131 CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 131 CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 132 if (command_line.HasSwitch(switches::kCheckLayoutTestSysDeps)) { | 132 if (command_line.HasSwitch(switches::kCheckLayoutTestSysDeps)) { |
| 133 // If CheckLayoutSystemDeps succeeds, we don't exit early. Instead we | 133 // If CheckLayoutSystemDeps succeeds, we don't exit early. Instead we |
| 134 // continue and try to load the fonts in WebKitTestPlatformInitialize | 134 // continue and try to load the fonts in BlinkTestPlatformInitialize |
| 135 // below, and then try to bring up the rest of the content module. | 135 // below, and then try to bring up the rest of the content module. |
| 136 if (!CheckLayoutSystemDeps()) { | 136 if (!CheckLayoutSystemDeps()) { |
| 137 if (exit_code) | 137 if (exit_code) |
| 138 *exit_code = 1; | 138 *exit_code = 1; |
| 139 return true; | 139 return true; |
| 140 } | 140 } |
| 141 } | 141 } |
| 142 | 142 |
| 143 if (command_line.HasSwitch(switches::kDumpRenderTree)) { | 143 if (command_line.HasSwitch(switches::kDumpRenderTree)) { |
| 144 EnableBrowserLayoutTestMode(); | 144 EnableBrowserLayoutTestMode(); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 | 183 |
| 184 command_line.AppendSwitchASCII(switches::kHostResolverRules, | 184 command_line.AppendSwitchASCII(switches::kHostResolverRules, |
| 185 "MAP *.test 127.0.0.1"); | 185 "MAP *.test 127.0.0.1"); |
| 186 | 186 |
| 187 // Unless/until WebM files are added to the media layout tests, we need to | 187 // Unless/until WebM files are added to the media layout tests, we need to |
| 188 // avoid removing MP4/H264/AAC so that layout tests can run on Android. | 188 // avoid removing MP4/H264/AAC so that layout tests can run on Android. |
| 189 #if !defined(OS_ANDROID) | 189 #if !defined(OS_ANDROID) |
| 190 net::RemoveProprietaryMediaTypesAndCodecsForTests(); | 190 net::RemoveProprietaryMediaTypesAndCodecsForTests(); |
| 191 #endif | 191 #endif |
| 192 | 192 |
| 193 if (!WebKitTestPlatformInitialize()) { | 193 if (!BlinkTestPlatformInitialize()) { |
| 194 if (exit_code) | 194 if (exit_code) |
| 195 *exit_code = 1; | 195 *exit_code = 1; |
| 196 return true; | 196 return true; |
| 197 } | 197 } |
| 198 } | 198 } |
| 199 SetContentClient(&content_client_); | 199 SetContentClient(&content_client_); |
| 200 return false; | 200 return false; |
| 201 } | 201 } |
| 202 | 202 |
| 203 void ShellMainDelegate::PreSandboxStartup() { | 203 void ShellMainDelegate::PreSandboxStartup() { |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 | 314 |
| 315 ContentRendererClient* ShellMainDelegate::CreateContentRendererClient() { | 315 ContentRendererClient* ShellMainDelegate::CreateContentRendererClient() { |
| 316 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) | 316 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) |
| 317 renderer_client_.reset(new LayoutTestContentRendererClient); | 317 renderer_client_.reset(new LayoutTestContentRendererClient); |
| 318 else | 318 else |
| 319 renderer_client_.reset(new ShellContentRendererClient); | 319 renderer_client_.reset(new ShellContentRendererClient); |
| 320 return renderer_client_.get(); | 320 return renderer_client_.get(); |
| 321 } | 321 } |
| 322 | 322 |
| 323 } // namespace content | 323 } // namespace content |
| OLD | NEW |