| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/browser/layout_test/layout_test_content_browser_client.h
" | 5 #include "content/shell/browser/layout_test/layout_test_content_browser_client.h
" |
| 6 | 6 |
| 7 #include "content/public/browser/browser_context.h" | 7 #include "content/public/browser/browser_context.h" |
| 8 #include "content/public/browser/browser_thread.h" | 8 #include "content/public/browser/browser_thread.h" |
| 9 #include "content/public/browser/navigator_connect_context.h" | 9 #include "content/public/browser/navigator_connect_context.h" |
| 10 #include "content/public/browser/render_process_host.h" | 10 #include "content/public/browser/render_process_host.h" |
| 11 #include "content/public/browser/resource_dispatcher_host.h" | 11 #include "content/public/browser/resource_dispatcher_host.h" |
| 12 #include "content/public/browser/storage_partition.h" | 12 #include "content/public/browser/storage_partition.h" |
| 13 #include "content/shell/browser/layout_test/blink_test_controller.h" | 13 #include "content/shell/browser/layout_test/blink_test_controller.h" |
| 14 #include "content/shell/browser/layout_test/layout_test_browser_context.h" | 14 #include "content/shell/browser/layout_test/layout_test_browser_context.h" |
| 15 #include "content/shell/browser/layout_test/layout_test_browser_main_parts.h" | 15 #include "content/shell/browser/layout_test/layout_test_browser_main_parts.h" |
| 16 #include "content/shell/browser/layout_test/layout_test_message_filter.h" | 16 #include "content/shell/browser/layout_test/layout_test_message_filter.h" |
| 17 #include "content/shell/browser/layout_test/layout_test_navigator_connect_servic
e_factory.h" | 17 #include "content/shell/browser/layout_test/layout_test_navigator_connect_servic
e_factory.h" |
| 18 #include "content/shell/browser/layout_test/layout_test_notification_manager.h" | 18 #include "content/shell/browser/layout_test/layout_test_notification_manager.h" |
| 19 #include "content/shell/browser/layout_test/layout_test_resource_dispatcher_host
_delegate.h" | 19 #include "content/shell/browser/layout_test/layout_test_resource_dispatcher_host
_delegate.h" |
| 20 #include "content/shell/browser/shell_browser_context.h" | 20 #include "content/shell/browser/shell_browser_context.h" |
| 21 #include "content/shell/common/layout_test/layout_test_switches.h" |
| 21 #include "content/shell/common/shell_messages.h" | 22 #include "content/shell/common/shell_messages.h" |
| 22 #include "content/shell/common/shell_switches.h" | |
| 23 #include "content/shell/renderer/layout_test/blink_test_helpers.h" | 23 #include "content/shell/renderer/layout_test/blink_test_helpers.h" |
| 24 | 24 |
| 25 namespace content { | 25 namespace content { |
| 26 namespace { | 26 namespace { |
| 27 | 27 |
| 28 LayoutTestContentBrowserClient* g_layout_test_browser_client; | 28 LayoutTestContentBrowserClient* g_layout_test_browser_client; |
| 29 | 29 |
| 30 } // namespace | 30 } // namespace |
| 31 | 31 |
| 32 LayoutTestContentBrowserClient::LayoutTestContentBrowserClient() { | 32 LayoutTestContentBrowserClient::LayoutTestContentBrowserClient() { |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 ResourceDispatcherHost::Get()->SetDelegate( | 82 ResourceDispatcherHost::Get()->SetDelegate( |
| 83 resource_dispatcher_host_delegate()); | 83 resource_dispatcher_host_delegate()); |
| 84 } | 84 } |
| 85 | 85 |
| 86 void LayoutTestContentBrowserClient::AppendExtraCommandLineSwitches( | 86 void LayoutTestContentBrowserClient::AppendExtraCommandLineSwitches( |
| 87 base::CommandLine* command_line, | 87 base::CommandLine* command_line, |
| 88 int child_process_id) { | 88 int child_process_id) { |
| 89 command_line->AppendSwitch(switches::kRunLayoutTest); | 89 command_line->AppendSwitch(switches::kRunLayoutTest); |
| 90 ShellContentBrowserClient::AppendExtraCommandLineSwitches(command_line, | 90 ShellContentBrowserClient::AppendExtraCommandLineSwitches(command_line, |
| 91 child_process_id); | 91 child_process_id); |
| 92 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 93 switches::kAlwaysUseComplexText)) { |
| 94 command_line->AppendSwitch(switches::kAlwaysUseComplexText); |
| 95 } |
| 96 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 97 switches::kEnableFontAntialiasing)) { |
| 98 command_line->AppendSwitch(switches::kEnableFontAntialiasing); |
| 99 } |
| 100 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 101 switches::kExposeInternalsForTesting)) { |
| 102 command_line->AppendSwitch(switches::kExposeInternalsForTesting); |
| 103 } |
| 104 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 105 switches::kStableReleaseMode)) { |
| 106 command_line->AppendSwitch(switches::kStableReleaseMode); |
| 107 } |
| 108 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 109 switches::kEnableLeakDetection)) { |
| 110 command_line->AppendSwitchASCII( |
| 111 switches::kEnableLeakDetection, |
| 112 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
| 113 switches::kEnableLeakDetection)); |
| 114 } |
| 92 } | 115 } |
| 93 | 116 |
| 94 BrowserMainParts* LayoutTestContentBrowserClient::CreateBrowserMainParts( | 117 BrowserMainParts* LayoutTestContentBrowserClient::CreateBrowserMainParts( |
| 95 const MainFunctionParams& parameters) { | 118 const MainFunctionParams& parameters) { |
| 96 set_browser_main_parts(new LayoutTestBrowserMainParts(parameters)); | 119 set_browser_main_parts(new LayoutTestBrowserMainParts(parameters)); |
| 97 return shell_browser_main_parts(); | 120 return shell_browser_main_parts(); |
| 98 } | 121 } |
| 99 | 122 |
| 100 PlatformNotificationService* | 123 PlatformNotificationService* |
| 101 LayoutTestContentBrowserClient::GetPlatformNotificationService() { | 124 LayoutTestContentBrowserClient::GetPlatformNotificationService() { |
| 102 return layout_test_notification_manager_.get(); | 125 return layout_test_notification_manager_.get(); |
| 103 } | 126 } |
| 104 | 127 |
| 105 void LayoutTestContentBrowserClient::GetAdditionalNavigatorConnectServices( | 128 void LayoutTestContentBrowserClient::GetAdditionalNavigatorConnectServices( |
| 106 const scoped_refptr<NavigatorConnectContext>& context) { | 129 const scoped_refptr<NavigatorConnectContext>& context) { |
| 107 context->AddFactory( | 130 context->AddFactory( |
| 108 make_scoped_ptr(new LayoutTestNavigatorConnectServiceFactory)); | 131 make_scoped_ptr(new LayoutTestNavigatorConnectServiceFactory)); |
| 109 } | 132 } |
| 110 | 133 |
| 111 } // namespace content | 134 } // namespace content |
| OLD | NEW |