| 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/renderer/test_runner/test_interfaces.h" | 5 #include "content/shell/renderer/test_runner/test_interfaces.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/command_line.h" | |
| 10 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
| 11 #include "base/json/string_escape.h" | 10 #include "base/json/string_escape.h" |
| 12 #include "base/logging.h" | 11 #include "base/logging.h" |
| 13 #include "base/strings/stringprintf.h" | 12 #include "base/strings/stringprintf.h" |
| 14 #include "base/values.h" | 13 #include "base/values.h" |
| 15 #include "content/shell/common/shell_switches.h" | |
| 16 #include "content/shell/renderer/test_runner/accessibility_controller.h" | 14 #include "content/shell/renderer/test_runner/accessibility_controller.h" |
| 17 #include "content/shell/renderer/test_runner/event_sender.h" | 15 #include "content/shell/renderer/test_runner/event_sender.h" |
| 18 #include "content/shell/renderer/test_runner/gamepad_controller.h" | 16 #include "content/shell/renderer/test_runner/gamepad_controller.h" |
| 19 #include "content/shell/renderer/test_runner/test_runner.h" | 17 #include "content/shell/renderer/test_runner/test_runner.h" |
| 20 #include "content/shell/renderer/test_runner/text_input_controller.h" | 18 #include "content/shell/renderer/test_runner/text_input_controller.h" |
| 21 #include "content/shell/renderer/test_runner/web_test_proxy.h" | 19 #include "content/shell/renderer/test_runner/web_test_proxy.h" |
| 22 #include "third_party/WebKit/public/platform/WebURL.h" | 20 #include "third_party/WebKit/public/platform/WebURL.h" |
| 23 #include "third_party/WebKit/public/web/WebCache.h" | 21 #include "third_party/WebKit/public/web/WebCache.h" |
| 24 #include "third_party/WebKit/public/web/WebKit.h" | 22 #include "third_party/WebKit/public/web/WebKit.h" |
| 25 #include "third_party/WebKit/public/web/WebView.h" | 23 #include "third_party/WebKit/public/web/WebView.h" |
| 26 | 24 |
| 27 namespace content { | 25 namespace content { |
| 28 | 26 |
| 29 TestInterfaces::TestInterfaces() | 27 TestInterfaces::TestInterfaces() |
| 30 : accessibility_controller_(new AccessibilityController()), | 28 : accessibility_controller_(new AccessibilityController()), |
| 31 event_sender_(new EventSender(this)), | 29 event_sender_(new EventSender(this)), |
| 32 text_input_controller_(new TextInputController()), | 30 text_input_controller_(new TextInputController()), |
| 33 test_runner_(new TestRunner(this)), | 31 test_runner_(new TestRunner(this)), |
| 34 delegate_(0) { | 32 delegate_(0) { |
| 35 blink::setLayoutTestMode(true); | 33 blink::setLayoutTestMode(true); |
| 36 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | |
| 37 switches::kEnableFontAntialiasing)) | |
| 38 blink::setFontAntialiasingEnabledForTest(true); | |
| 39 | |
| 40 // NOTE: please don't put feature specific enable flags here, | 34 // NOTE: please don't put feature specific enable flags here, |
| 41 // instead add them to RuntimeEnabledFeatures.in | 35 // instead add them to RuntimeEnabledFeatures.in |
| 42 | 36 |
| 43 ResetAll(); | 37 ResetAll(); |
| 44 } | 38 } |
| 45 | 39 |
| 46 TestInterfaces::~TestInterfaces() { | 40 TestInterfaces::~TestInterfaces() { |
| 47 accessibility_controller_->SetWebView(0); | 41 accessibility_controller_->SetWebView(0); |
| 48 event_sender_->SetWebView(0); | 42 event_sender_->SetWebView(0); |
| 49 // gamepad_controller_ doesn't depend on WebView. | 43 // gamepad_controller_ doesn't depend on WebView. |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 | 169 |
| 176 blink::WebThemeEngine* TestInterfaces::GetThemeEngine() { | 170 blink::WebThemeEngine* TestInterfaces::GetThemeEngine() { |
| 177 if (!test_runner_->UseMockTheme()) | 171 if (!test_runner_->UseMockTheme()) |
| 178 return 0; | 172 return 0; |
| 179 if (!theme_engine_.get()) | 173 if (!theme_engine_.get()) |
| 180 theme_engine_.reset(new MockWebThemeEngine()); | 174 theme_engine_.reset(new MockWebThemeEngine()); |
| 181 return theme_engine_.get(); | 175 return theme_engine_.get(); |
| 182 } | 176 } |
| 183 | 177 |
| 184 } // namespace content | 178 } // namespace content |
| OLD | NEW |