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" |
11 #include "components/test_runner/web_frame_test_proxy.h" | 11 #include "components/test_runner/web_frame_test_proxy.h" |
12 #include "components/test_runner/web_test_interfaces.h" | 12 #include "components/test_runner/web_test_interfaces.h" |
13 #include "components/test_runner/web_test_runner.h" | 13 #include "components/test_runner/web_test_runner.h" |
14 #include "components/test_runner/web_view_test_proxy.h" | 14 #include "components/test_runner/web_view_test_proxy.h" |
15 #include "components/web_cache/renderer/web_cache_impl.h" | 15 #include "components/web_cache/renderer/web_cache_impl.h" |
16 #include "content/public/common/content_constants.h" | 16 #include "content/public/common/content_constants.h" |
17 #include "content/public/common/content_switches.h" | 17 #include "content/public/common/content_switches.h" |
18 #include "content/public/renderer/render_frame.h" | 18 #include "content/public/renderer/render_frame.h" |
19 #include "content/public/renderer/render_view.h" | 19 #include "content/public/renderer/render_view.h" |
20 #include "content/public/test/layouttest_support.h" | 20 #include "content/public/test/layouttest_support.h" |
21 #include "content/shell/common/layout_test/layout_test_switches.h" | |
21 #include "content/shell/common/shell_switches.h" | 22 #include "content/shell/common/shell_switches.h" |
22 #include "content/shell/renderer/layout_test/blink_test_helpers.h" | 23 #include "content/shell/renderer/layout_test/blink_test_helpers.h" |
23 #include "content/shell/renderer/layout_test/blink_test_runner.h" | 24 #include "content/shell/renderer/layout_test/blink_test_runner.h" |
24 #include "content/shell/renderer/layout_test/layout_test_render_frame_observer.h " | 25 #include "content/shell/renderer/layout_test/layout_test_render_frame_observer.h " |
25 #include "content/shell/renderer/layout_test/layout_test_render_thread_observer. h" | 26 #include "content/shell/renderer/layout_test/layout_test_render_thread_observer. h" |
26 #include "content/shell/renderer/layout_test/test_media_stream_renderer_factory. h" | 27 #include "content/shell/renderer/layout_test/test_media_stream_renderer_factory. h" |
27 #include "content/shell/renderer/shell_render_view_observer.h" | 28 #include "content/shell/renderer/shell_render_view_observer.h" |
28 #include "content/test/mock_webclipboard_impl.h" | 29 #include "content/test/mock_webclipboard_impl.h" |
29 #include "ppapi/shared_impl/ppapi_switches.h" | 30 #include "ppapi/shared_impl/ppapi_switches.h" |
30 #include "third_party/WebKit/public/platform/WebMediaStreamCenter.h" | 31 #include "third_party/WebKit/public/platform/WebMediaStreamCenter.h" |
31 #include "third_party/WebKit/public/platform/modules/app_banner/WebAppBannerClie nt.h" | 32 #include "third_party/WebKit/public/platform/modules/app_banner/WebAppBannerClie nt.h" |
32 #include "third_party/WebKit/public/web/WebFrameWidget.h" | 33 #include "third_party/WebKit/public/web/WebFrameWidget.h" |
34 #include "third_party/WebKit/public/web/WebKit.h" | |
33 #include "third_party/WebKit/public/web/WebPluginParams.h" | 35 #include "third_party/WebKit/public/web/WebPluginParams.h" |
36 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" | |
34 #include "third_party/WebKit/public/web/WebTestingSupport.h" | 37 #include "third_party/WebKit/public/web/WebTestingSupport.h" |
35 #include "third_party/WebKit/public/web/WebView.h" | 38 #include "third_party/WebKit/public/web/WebView.h" |
36 #include "ui/gfx/icc_profile.h" | 39 #include "ui/gfx/icc_profile.h" |
37 #include "v8/include/v8.h" | 40 #include "v8/include/v8.h" |
38 | 41 |
39 using blink::WebAudioDevice; | 42 using blink::WebAudioDevice; |
40 using blink::WebClipboard; | 43 using blink::WebClipboard; |
41 using blink::WebFrame; | 44 using blink::WebFrame; |
42 using blink::WebLocalFrame; | 45 using blink::WebLocalFrame; |
43 using blink::WebMIDIAccessor; | 46 using blink::WebMIDIAccessor; |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
240 #else | 243 #else |
241 return base::WrapUnique(new gfx::ICCProfile()); | 244 return base::WrapUnique(new gfx::ICCProfile()); |
242 #endif | 245 #endif |
243 } | 246 } |
244 | 247 |
245 void LayoutTestContentRendererClient::DidInitializeWorkerContextOnWorkerThread( | 248 void LayoutTestContentRendererClient::DidInitializeWorkerContextOnWorkerThread( |
246 v8::Local<v8::Context> context) { | 249 v8::Local<v8::Context> context) { |
247 blink::WebTestingSupport::injectInternalsObject(context); | 250 blink::WebTestingSupport::injectInternalsObject(context); |
248 } | 251 } |
249 | 252 |
253 void LayoutTestContentRendererClient:: | |
254 SetRuntimeFeaturesDefaultsBeforeBlinkInitialization() { | |
255 EnableRendererLayoutTestMode(); | |
jochen (gone - plz use gerrit)
2016/09/16 15:32:45
This will crash windows
| |
256 | |
257 // We always expose GC to layout tests. | |
258 std::string flags("--expose-gc"); | |
259 v8::V8::SetFlagsFromString(flags.c_str(), static_cast<int>(flags.size())); | |
260 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( | |
261 switches::kStableReleaseMode)) { | |
262 blink::WebRuntimeFeatures::enableTestOnlyFeatures(true); | |
263 } | |
264 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | |
265 switches::kEnableFontAntialiasing)) { | |
266 blink::setFontAntialiasingEnabledForTest(true); | |
267 } | |
268 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | |
269 switches::kAlwaysUseComplexText)) { | |
270 blink::setAlwaysUseComplexTextForTest(true); | |
271 } | |
272 } | |
273 | |
250 } // namespace content | 274 } // namespace content |
OLD | NEW |