| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/TestInterfaces.h" | 5 #include "content/shell/renderer/test_runner/TestInterfaces.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/strings/stringprintf.h" | 11 #include "base/strings/stringprintf.h" |
| 12 #include "content/shell/common/shell_switches.h" | 12 #include "content/shell/common/shell_switches.h" |
| 13 #include "content/shell/renderer/test_runner/WebTestProxy.h" | 13 #include "content/shell/renderer/test_runner/WebTestProxy.h" |
| 14 #include "content/shell/renderer/test_runner/accessibility_controller.h" | 14 #include "content/shell/renderer/test_runner/accessibility_controller.h" |
| 15 #include "content/shell/renderer/test_runner/event_sender.h" | 15 #include "content/shell/renderer/test_runner/event_sender.h" |
| 16 #include "content/shell/renderer/test_runner/gamepad_controller.h" | 16 #include "content/shell/renderer/test_runner/gamepad_controller.h" |
| 17 #include "content/shell/renderer/test_runner/text_input_controller.h" | 17 #include "content/shell/renderer/test_runner/text_input_controller.h" |
| 18 #include "content/shell/renderer/test_runner/test_runner.h" | 18 #include "content/shell/renderer/test_runner/test_runner.h" |
| 19 #include "third_party/WebKit/public/platform/WebString.h" | 19 #include "third_party/WebKit/public/platform/WebString.h" |
| 20 #include "third_party/WebKit/public/platform/WebURL.h" | 20 #include "third_party/WebKit/public/platform/WebURL.h" |
| 21 #include "third_party/WebKit/public/web/WebCache.h" | 21 #include "third_party/WebKit/public/web/WebCache.h" |
| 22 #include "third_party/WebKit/public/web/WebKit.h" | 22 #include "third_party/WebKit/public/web/WebKit.h" |
| 23 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" | 23 #include "third_party/WebKit/public/web/WebRuntimeFeatures.h" |
| 24 #include "third_party/WebKit/public/web/WebView.h" | 24 #include "third_party/WebKit/public/web/WebView.h" |
| 25 | 25 |
| 26 using namespace blink; | 26 using namespace blink; |
| 27 using namespace content; | |
| 28 using namespace std; | 27 using namespace std; |
| 29 | 28 |
| 30 namespace WebTestRunner { | 29 namespace content { |
| 31 | 30 |
| 32 TestInterfaces::TestInterfaces() | 31 TestInterfaces::TestInterfaces() |
| 33 : m_accessibilityController(new content::AccessibilityController()) | 32 : m_accessibilityController(new AccessibilityController()) |
| 34 , m_eventSender(new content::EventSender(this)) | 33 , m_eventSender(new EventSender(this)) |
| 35 , m_gamepadController(new content::GamepadController()) | 34 , m_gamepadController(new GamepadController()) |
| 36 , m_textInputController(new content::TextInputController()) | 35 , m_textInputController(new TextInputController()) |
| 37 , m_testRunner(new content::TestRunner(this)) | 36 , m_testRunner(new TestRunner(this)) |
| 38 , m_delegate(0) | 37 , m_delegate(0) |
| 39 { | 38 { |
| 40 blink::setLayoutTestMode(true); | 39 blink::setLayoutTestMode(true); |
| 41 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableFontSmoothi
ng)) | 40 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableFontSmoothi
ng)) |
| 42 blink::setFontSmoothingEnabledForTest(true); | 41 blink::setFontSmoothingEnabledForTest(true); |
| 43 | 42 |
| 44 // NOTE: please don't put feature specific enable flags here, | 43 // NOTE: please don't put feature specific enable flags here, |
| 45 // instead add them to RuntimeEnabledFeatures.in | 44 // instead add them to RuntimeEnabledFeatures.in |
| 46 | 45 |
| 47 resetAll(); | 46 resetAll(); |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 void TestInterfaces::windowClosed(WebTestProxyBase* proxy) | 150 void TestInterfaces::windowClosed(WebTestProxyBase* proxy) |
| 152 { | 151 { |
| 153 vector<WebTestProxyBase*>::iterator pos = find(m_windowList.begin(), m_windo
wList.end(), proxy); | 152 vector<WebTestProxyBase*>::iterator pos = find(m_windowList.begin(), m_windo
wList.end(), proxy); |
| 154 if (pos == m_windowList.end()) { | 153 if (pos == m_windowList.end()) { |
| 155 NOTREACHED(); | 154 NOTREACHED(); |
| 156 return; | 155 return; |
| 157 } | 156 } |
| 158 m_windowList.erase(pos); | 157 m_windowList.erase(pos); |
| 159 } | 158 } |
| 160 | 159 |
| 161 content::AccessibilityController* TestInterfaces::accessibilityController() | 160 AccessibilityController* TestInterfaces::accessibilityController() |
| 162 { | 161 { |
| 163 return m_accessibilityController.get(); | 162 return m_accessibilityController.get(); |
| 164 } | 163 } |
| 165 | 164 |
| 166 content::EventSender* TestInterfaces::eventSender() | 165 EventSender* TestInterfaces::eventSender() |
| 167 { | 166 { |
| 168 return m_eventSender.get(); | 167 return m_eventSender.get(); |
| 169 } | 168 } |
| 170 | 169 |
| 171 content::TestRunner* TestInterfaces::testRunner() | 170 TestRunner* TestInterfaces::testRunner() |
| 172 { | 171 { |
| 173 return m_testRunner.get(); | 172 return m_testRunner.get(); |
| 174 } | 173 } |
| 175 | 174 |
| 176 WebTestDelegate* TestInterfaces::delegate() | 175 WebTestDelegate* TestInterfaces::delegate() |
| 177 { | 176 { |
| 178 return m_delegate; | 177 return m_delegate; |
| 179 } | 178 } |
| 180 | 179 |
| 181 WebTestProxyBase* TestInterfaces::proxy() | 180 WebTestProxyBase* TestInterfaces::proxy() |
| (...skipping 13 matching lines...) Expand all Loading... |
| 195 #if defined(__APPLE__) | 194 #if defined(__APPLE__) |
| 196 if (!m_themeEngine.get()) | 195 if (!m_themeEngine.get()) |
| 197 m_themeEngine.reset(new WebTestThemeEngineMac()); | 196 m_themeEngine.reset(new WebTestThemeEngineMac()); |
| 198 #else | 197 #else |
| 199 if (!m_themeEngine.get()) | 198 if (!m_themeEngine.get()) |
| 200 m_themeEngine.reset(new WebTestThemeEngineMock()); | 199 m_themeEngine.reset(new WebTestThemeEngineMock()); |
| 201 #endif | 200 #endif |
| 202 return m_themeEngine.get(); | 201 return m_themeEngine.get(); |
| 203 } | 202 } |
| 204 | 203 |
| 205 } | 204 } // namespace content |
| OLD | NEW |