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_render_process_observer
.h" | 5 #include "content/shell/renderer/layout_test/layout_test_render_process_observer
.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "content/public/common/content_client.h" | 8 #include "content/public/common/content_client.h" |
9 #include "content/public/renderer/render_thread.h" | 9 #include "content/public/renderer/render_thread.h" |
10 #include "content/public/renderer/render_view.h" | 10 #include "content/public/renderer/render_view.h" |
11 #include "content/public/test/layouttest_support.h" | 11 #include "content/public/test/layouttest_support.h" |
12 #include "content/shell/common/shell_messages.h" | 12 #include "content/shell/common/shell_messages.h" |
13 #include "content/shell/common/shell_switches.h" | 13 #include "content/shell/common/shell_switches.h" |
14 #include "content/shell/renderer/layout_test/blink_test_runner.h" | 14 #include "content/shell/renderer/layout_test/blink_test_runner.h" |
15 #include "content/shell/renderer/test_runner/web_test_interfaces.h" | 15 #include "content/shell/renderer/test_runner/web_test_interfaces.h" |
| 16 #include "third_party/WebKit/public/web/WebKit.h" |
16 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" | 17 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" |
17 #include "third_party/WebKit/public/web/WebView.h" | 18 #include "third_party/WebKit/public/web/WebView.h" |
18 #include "v8/include/v8.h" | 19 #include "v8/include/v8.h" |
19 | 20 |
20 using blink::WebFrame; | 21 using blink::WebFrame; |
21 using blink::WebRuntimeFeatures; | 22 using blink::WebRuntimeFeatures; |
22 | 23 |
23 namespace content { | 24 namespace content { |
24 | 25 |
25 namespace { | 26 namespace { |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 std::string flags("--expose-gc"); | 64 std::string flags("--expose-gc"); |
64 v8::V8::SetFlagsFromString(flags.c_str(), static_cast<int>(flags.size())); | 65 v8::V8::SetFlagsFromString(flags.c_str(), static_cast<int>(flags.size())); |
65 | 66 |
66 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( | 67 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( |
67 switches::kStableReleaseMode)) { | 68 switches::kStableReleaseMode)) { |
68 WebRuntimeFeatures::enableTestOnlyFeatures(true); | 69 WebRuntimeFeatures::enableTestOnlyFeatures(true); |
69 } | 70 } |
70 | 71 |
71 test_interfaces_.reset(new WebTestInterfaces); | 72 test_interfaces_.reset(new WebTestInterfaces); |
72 test_interfaces_->ResetAll(); | 73 test_interfaces_->ResetAll(); |
| 74 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 75 switches::kEnableFontAntialiasing)) { |
| 76 blink::setFontAntialiasingEnabledForTest(true); |
| 77 } |
| 78 |
73 } | 79 } |
74 | 80 |
75 void LayoutTestRenderProcessObserver::OnRenderProcessShutdown() { | 81 void LayoutTestRenderProcessObserver::OnRenderProcessShutdown() { |
76 test_interfaces_.reset(); | 82 test_interfaces_.reset(); |
77 } | 83 } |
78 | 84 |
79 bool LayoutTestRenderProcessObserver::OnControlMessageReceived( | 85 bool LayoutTestRenderProcessObserver::OnControlMessageReceived( |
80 const IPC::Message& message) { | 86 const IPC::Message& message) { |
81 bool handled = true; | 87 bool handled = true; |
82 IPC_BEGIN_MESSAGE_MAP(LayoutTestRenderProcessObserver, message) | 88 IPC_BEGIN_MESSAGE_MAP(LayoutTestRenderProcessObserver, message) |
83 IPC_MESSAGE_HANDLER(ShellViewMsg_SetWebKitSourceDir, OnSetWebKitSourceDir) | 89 IPC_MESSAGE_HANDLER(ShellViewMsg_SetWebKitSourceDir, OnSetWebKitSourceDir) |
84 IPC_MESSAGE_UNHANDLED(handled = false) | 90 IPC_MESSAGE_UNHANDLED(handled = false) |
85 IPC_END_MESSAGE_MAP() | 91 IPC_END_MESSAGE_MAP() |
86 | 92 |
87 return handled; | 93 return handled; |
88 } | 94 } |
89 | 95 |
90 void LayoutTestRenderProcessObserver::OnSetWebKitSourceDir( | 96 void LayoutTestRenderProcessObserver::OnSetWebKitSourceDir( |
91 const base::FilePath& webkit_source_dir) { | 97 const base::FilePath& webkit_source_dir) { |
92 webkit_source_dir_ = webkit_source_dir; | 98 webkit_source_dir_ = webkit_source_dir; |
93 } | 99 } |
94 | 100 |
95 } // namespace content | 101 } // namespace content |
OLD | NEW |