| 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/WebTestProxy.h" | 5 #include "content/shell/renderer/test_runner/WebTestProxy.h" |
| 6 | 6 |
| 7 #include <cctype> | 7 #include <cctype> |
| 8 | 8 |
| 9 #include "content/shell/renderer/test_runner/AccessibilityController.h" | |
| 10 #include "content/shell/renderer/test_runner/EventSender.h" | 9 #include "content/shell/renderer/test_runner/EventSender.h" |
| 11 #include "content/shell/renderer/test_runner/MockColorChooser.h" | 10 #include "content/shell/renderer/test_runner/MockColorChooser.h" |
| 12 #include "content/shell/renderer/test_runner/MockWebSpeechInputController.h" | 11 #include "content/shell/renderer/test_runner/MockWebSpeechInputController.h" |
| 13 #include "content/shell/renderer/test_runner/MockWebSpeechRecognizer.h" | 12 #include "content/shell/renderer/test_runner/MockWebSpeechRecognizer.h" |
| 14 #include "content/shell/renderer/test_runner/SpellCheckClient.h" | 13 #include "content/shell/renderer/test_runner/SpellCheckClient.h" |
| 15 #include "content/shell/renderer/test_runner/TestCommon.h" | 14 #include "content/shell/renderer/test_runner/TestCommon.h" |
| 16 #include "content/shell/renderer/test_runner/TestInterfaces.h" | 15 #include "content/shell/renderer/test_runner/TestInterfaces.h" |
| 17 #include "content/shell/renderer/test_runner/TestPlugin.h" | 16 #include "content/shell/renderer/test_runner/TestPlugin.h" |
| 18 #include "content/shell/renderer/test_runner/TestRunner.h" | 17 #include "content/shell/renderer/test_runner/TestRunner.h" |
| 19 #include "content/shell/renderer/test_runner/WebTestDelegate.h" | 18 #include "content/shell/renderer/test_runner/WebTestDelegate.h" |
| 20 #include "content/shell/renderer/test_runner/WebTestInterfaces.h" | 19 #include "content/shell/renderer/test_runner/WebTestInterfaces.h" |
| 21 #include "content/shell/renderer/test_runner/WebTestRunner.h" | 20 #include "content/shell/renderer/test_runner/WebTestRunner.h" |
| 22 #include "content/shell/renderer/test_runner/WebUserMediaClientMock.h" | 21 #include "content/shell/renderer/test_runner/WebUserMediaClientMock.h" |
| 22 #include "content/shell/renderer/test_runner/accessibility_controller.h" |
| 23 // FIXME: Including platform_canvas.h here is a layering violation. | 23 // FIXME: Including platform_canvas.h here is a layering violation. |
| 24 #include "skia/ext/platform_canvas.h" | 24 #include "skia/ext/platform_canvas.h" |
| 25 #include "third_party/WebKit/public/platform/WebCString.h" | 25 #include "third_party/WebKit/public/platform/WebCString.h" |
| 26 #include "third_party/WebKit/public/platform/WebURLError.h" | 26 #include "third_party/WebKit/public/platform/WebURLError.h" |
| 27 #include "third_party/WebKit/public/platform/WebURLRequest.h" | 27 #include "third_party/WebKit/public/platform/WebURLRequest.h" |
| 28 #include "third_party/WebKit/public/platform/WebURLResponse.h" | 28 #include "third_party/WebKit/public/platform/WebURLResponse.h" |
| 29 #include "third_party/WebKit/public/web/WebAXEnums.h" | 29 #include "third_party/WebKit/public/web/WebAXEnums.h" |
| 30 #include "third_party/WebKit/public/web/WebAXObject.h" | 30 #include "third_party/WebKit/public/web/WebAXObject.h" |
| 31 #include "third_party/WebKit/public/web/WebCachedURLRequest.h" | 31 #include "third_party/WebKit/public/web/WebCachedURLRequest.h" |
| 32 #include "third_party/WebKit/public/web/WebConsoleMessage.h" | 32 #include "third_party/WebKit/public/web/WebConsoleMessage.h" |
| (...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 752 } | 752 } |
| 753 | 753 |
| 754 void WebTestProxyBase::didAutoResize(const WebSize&) | 754 void WebTestProxyBase::didAutoResize(const WebSize&) |
| 755 { | 755 { |
| 756 invalidateAll(); | 756 invalidateAll(); |
| 757 } | 757 } |
| 758 | 758 |
| 759 void WebTestProxyBase::postAccessibilityEvent(const blink::WebAXObject& obj, bli
nk::WebAXEvent event) | 759 void WebTestProxyBase::postAccessibilityEvent(const blink::WebAXObject& obj, bli
nk::WebAXEvent event) |
| 760 { | 760 { |
| 761 if (event == blink::WebAXEventFocus) | 761 if (event == blink::WebAXEventFocus) |
| 762 m_testInterfaces->accessibilityController()->setFocusedElement(obj); | 762 m_testInterfaces->accessibilityController()->SetFocusedElement(obj); |
| 763 | 763 |
| 764 const char* eventName = 0; | 764 const char* eventName = 0; |
| 765 switch (event) { | 765 switch (event) { |
| 766 case blink::WebAXEventActiveDescendantChanged: | 766 case blink::WebAXEventActiveDescendantChanged: |
| 767 eventName = "ActiveDescendantChanged"; | 767 eventName = "ActiveDescendantChanged"; |
| 768 break; | 768 break; |
| 769 case blink::WebAXEventAlert: | 769 case blink::WebAXEventAlert: |
| 770 eventName = "Alert"; | 770 eventName = "Alert"; |
| 771 break; | 771 break; |
| 772 case blink::WebAXEventAriaAttributeChanged: | 772 case blink::WebAXEventAriaAttributeChanged: |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 842 eventName = "TextRemoved"; | 842 eventName = "TextRemoved"; |
| 843 break; | 843 break; |
| 844 case blink::WebAXEventValueChanged: | 844 case blink::WebAXEventValueChanged: |
| 845 eventName = "ValueChanged"; | 845 eventName = "ValueChanged"; |
| 846 break; | 846 break; |
| 847 default: | 847 default: |
| 848 eventName = "Unknown"; | 848 eventName = "Unknown"; |
| 849 break; | 849 break; |
| 850 } | 850 } |
| 851 | 851 |
| 852 m_testInterfaces->accessibilityController()->notificationReceived(obj, event
Name); | 852 m_testInterfaces->accessibilityController()->NotificationReceived(obj, event
Name); |
| 853 | 853 |
| 854 if (m_testInterfaces->accessibilityController()->shouldLogAccessibilityEvent
s()) { | 854 if (m_testInterfaces->accessibilityController()->ShouldLogAccessibilityEvent
s()) { |
| 855 string message("AccessibilityNotification - "); | 855 string message("AccessibilityNotification - "); |
| 856 message += eventName; | 856 message += eventName; |
| 857 | 857 |
| 858 blink::WebNode node = obj.node(); | 858 blink::WebNode node = obj.node(); |
| 859 if (!node.isNull() && node.isElementNode()) { | 859 if (!node.isNull() && node.isElementNode()) { |
| 860 blink::WebElement element = node.to<blink::WebElement>(); | 860 blink::WebElement element = node.to<blink::WebElement>(); |
| 861 if (element.hasAttribute("id")) { | 861 if (element.hasAttribute("id")) { |
| 862 message += " - id:"; | 862 message += " - id:"; |
| 863 message += element.getAttribute("id").utf8().data(); | 863 message += element.getAttribute("id").utf8().data(); |
| 864 } | 864 } |
| (...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1352 | 1352 |
| 1353 void WebTestProxyBase::resetInputMethod() | 1353 void WebTestProxyBase::resetInputMethod() |
| 1354 { | 1354 { |
| 1355 // If a composition text exists, then we need to let the browser process | 1355 // If a composition text exists, then we need to let the browser process |
| 1356 // to cancel the input method's ongoing composition session. | 1356 // to cancel the input method's ongoing composition session. |
| 1357 if (m_webWidget) | 1357 if (m_webWidget) |
| 1358 m_webWidget->confirmComposition(); | 1358 m_webWidget->confirmComposition(); |
| 1359 } | 1359 } |
| 1360 | 1360 |
| 1361 } | 1361 } |
| OLD | NEW |