OLD | NEW |
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/renderer/layout_test/layout_test_content_renderer_client
.h" | 5 #include "content/shell/renderer/layout_test/layout_test_content_renderer_client
.h" |
6 | 6 |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/debugger.h" | 9 #include "base/debug/debugger.h" |
10 #include "components/test_runner/mock_credential_manager_client.h" | 10 #include "components/test_runner/mock_credential_manager_client.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 #include "content/shell/common/shell_switches.h" | 23 #include "content/shell/common/shell_switches.h" |
24 #include "content/shell/renderer/layout_test/blink_test_helpers.h" | 24 #include "content/shell/renderer/layout_test/blink_test_helpers.h" |
25 #include "content/shell/renderer/layout_test/blink_test_runner.h" | 25 #include "content/shell/renderer/layout_test/blink_test_runner.h" |
26 #include "content/shell/renderer/layout_test/interface_registry_js_wrapper.h" | 26 #include "content/shell/renderer/layout_test/interface_registry_js_wrapper.h" |
27 #include "content/shell/renderer/layout_test/layout_test_render_frame_observer.h
" | 27 #include "content/shell/renderer/layout_test/layout_test_render_frame_observer.h
" |
28 #include "content/shell/renderer/layout_test/layout_test_render_thread_observer.
h" | 28 #include "content/shell/renderer/layout_test/layout_test_render_thread_observer.
h" |
29 #include "content/shell/renderer/layout_test/test_media_stream_renderer_factory.
h" | 29 #include "content/shell/renderer/layout_test/test_media_stream_renderer_factory.
h" |
30 #include "content/shell/renderer/shell_render_view_observer.h" | 30 #include "content/shell/renderer/shell_render_view_observer.h" |
31 #include "content/test/mock_webclipboard_impl.h" | 31 #include "content/test/mock_webclipboard_impl.h" |
32 #include "gin/modules/module_registry.h" | 32 #include "gin/modules/module_registry.h" |
| 33 #include "media/media_features.h" |
33 #include "ppapi/shared_impl/ppapi_switches.h" | 34 #include "ppapi/shared_impl/ppapi_switches.h" |
34 #include "third_party/WebKit/public/platform/WebMediaStreamCenter.h" | 35 #include "third_party/WebKit/public/platform/WebMediaStreamCenter.h" |
35 #include "third_party/WebKit/public/web/WebFrameWidget.h" | 36 #include "third_party/WebKit/public/web/WebFrameWidget.h" |
36 #include "third_party/WebKit/public/web/WebKit.h" | 37 #include "third_party/WebKit/public/web/WebKit.h" |
37 #include "third_party/WebKit/public/web/WebPluginParams.h" | 38 #include "third_party/WebKit/public/web/WebPluginParams.h" |
38 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" | 39 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" |
39 #include "third_party/WebKit/public/web/WebTestingSupport.h" | 40 #include "third_party/WebKit/public/web/WebTestingSupport.h" |
40 #include "third_party/WebKit/public/web/WebView.h" | 41 #include "third_party/WebKit/public/web/WebView.h" |
41 #include "ui/gfx/icc_profile.h" | 42 #include "ui/gfx/icc_profile.h" |
42 #include "v8/include/v8.h" | 43 #include "v8/include/v8.h" |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 | 158 |
158 LayoutTestRenderThreadObserver::GetInstance() | 159 LayoutTestRenderThreadObserver::GetInstance() |
159 ->test_interfaces() | 160 ->test_interfaces() |
160 ->TestRunner() | 161 ->TestRunner() |
161 ->InitializeWebViewWithMocks(render_view->GetWebView()); | 162 ->InitializeWebViewWithMocks(render_view->GetWebView()); |
162 } | 163 } |
163 | 164 |
164 WebMediaStreamCenter* | 165 WebMediaStreamCenter* |
165 LayoutTestContentRendererClient::OverrideCreateWebMediaStreamCenter( | 166 LayoutTestContentRendererClient::OverrideCreateWebMediaStreamCenter( |
166 WebMediaStreamCenterClient* client) { | 167 WebMediaStreamCenterClient* client) { |
167 #if defined(ENABLE_WEBRTC) | 168 #if BUILDFLAG(ENABLE_WEBRTC) |
168 test_runner::WebTestInterfaces* interfaces = | 169 test_runner::WebTestInterfaces* interfaces = |
169 LayoutTestRenderThreadObserver::GetInstance()->test_interfaces(); | 170 LayoutTestRenderThreadObserver::GetInstance()->test_interfaces(); |
170 return interfaces->CreateMediaStreamCenter(client); | 171 return interfaces->CreateMediaStreamCenter(client); |
171 #else | 172 #else |
172 return NULL; | 173 return NULL; |
173 #endif | 174 #endif |
174 } | 175 } |
175 | 176 |
176 WebRTCPeerConnectionHandler* | 177 WebRTCPeerConnectionHandler* |
177 LayoutTestContentRendererClient::OverrideCreateWebRTCPeerConnectionHandler( | 178 LayoutTestContentRendererClient::OverrideCreateWebRTCPeerConnectionHandler( |
178 WebRTCPeerConnectionHandlerClient* client) { | 179 WebRTCPeerConnectionHandlerClient* client) { |
179 #if defined(ENABLE_WEBRTC) | 180 #if BUILDFLAG(ENABLE_WEBRTC) |
180 test_runner::WebTestInterfaces* interfaces = | 181 test_runner::WebTestInterfaces* interfaces = |
181 LayoutTestRenderThreadObserver::GetInstance()->test_interfaces(); | 182 LayoutTestRenderThreadObserver::GetInstance()->test_interfaces(); |
182 return interfaces->CreateWebRTCPeerConnectionHandler(client); | 183 return interfaces->CreateWebRTCPeerConnectionHandler(client); |
183 #else | 184 #else |
184 return NULL; | 185 return NULL; |
185 #endif | 186 #endif |
186 } | 187 } |
187 | 188 |
188 WebMIDIAccessor* | 189 WebMIDIAccessor* |
189 LayoutTestContentRendererClient::OverrideCreateMIDIAccessor( | 190 LayoutTestContentRendererClient::OverrideCreateMIDIAccessor( |
(...skipping 18 matching lines...) Expand all Loading... |
208 } | 209 } |
209 | 210 |
210 WebThemeEngine* LayoutTestContentRendererClient::OverrideThemeEngine() { | 211 WebThemeEngine* LayoutTestContentRendererClient::OverrideThemeEngine() { |
211 return LayoutTestRenderThreadObserver::GetInstance() | 212 return LayoutTestRenderThreadObserver::GetInstance() |
212 ->test_interfaces() | 213 ->test_interfaces() |
213 ->ThemeEngine(); | 214 ->ThemeEngine(); |
214 } | 215 } |
215 | 216 |
216 std::unique_ptr<MediaStreamRendererFactory> | 217 std::unique_ptr<MediaStreamRendererFactory> |
217 LayoutTestContentRendererClient::CreateMediaStreamRendererFactory() { | 218 LayoutTestContentRendererClient::CreateMediaStreamRendererFactory() { |
218 #if defined(ENABLE_WEBRTC) | 219 #if BUILDFLAG(ENABLE_WEBRTC) |
219 return std::unique_ptr<MediaStreamRendererFactory>( | 220 return std::unique_ptr<MediaStreamRendererFactory>( |
220 new TestMediaStreamRendererFactory()); | 221 new TestMediaStreamRendererFactory()); |
221 #else | 222 #else |
222 return nullptr; | 223 return nullptr; |
223 #endif | 224 #endif |
224 } | 225 } |
225 | 226 |
226 std::unique_ptr<gfx::ICCProfile> | 227 std::unique_ptr<gfx::ICCProfile> |
227 LayoutTestContentRendererClient::GetImageDecodeColorProfile() { | 228 LayoutTestContentRendererClient::GetImageDecodeColorProfile() { |
228 // TODO(ccameron): Make all platforms use the same color profile for layout | 229 // TODO(ccameron): Make all platforms use the same color profile for layout |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 switches::kStableReleaseMode)) { | 280 switches::kStableReleaseMode)) { |
280 blink::WebRuntimeFeatures::enableTestOnlyFeatures(true); | 281 blink::WebRuntimeFeatures::enableTestOnlyFeatures(true); |
281 } | 282 } |
282 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 283 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
283 switches::kEnableFontAntialiasing)) { | 284 switches::kEnableFontAntialiasing)) { |
284 blink::setFontAntialiasingEnabledForTest(true); | 285 blink::setFontAntialiasingEnabledForTest(true); |
285 } | 286 } |
286 } | 287 } |
287 | 288 |
288 } // namespace content | 289 } // namespace content |
OLD | NEW |