| 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" |
| 9 #include "content/shell/renderer/test_runner/EventSender.h" | 10 #include "content/shell/renderer/test_runner/EventSender.h" |
| 10 #include "content/shell/renderer/test_runner/MockColorChooser.h" | 11 #include "content/shell/renderer/test_runner/MockColorChooser.h" |
| 11 #include "content/shell/renderer/test_runner/MockWebSpeechInputController.h" | 12 #include "content/shell/renderer/test_runner/MockWebSpeechInputController.h" |
| 12 #include "content/shell/renderer/test_runner/MockWebSpeechRecognizer.h" | 13 #include "content/shell/renderer/test_runner/MockWebSpeechRecognizer.h" |
| 13 #include "content/shell/renderer/test_runner/SpellCheckClient.h" | 14 #include "content/shell/renderer/test_runner/SpellCheckClient.h" |
| 14 #include "content/shell/renderer/test_runner/TestCommon.h" | 15 #include "content/shell/renderer/test_runner/TestCommon.h" |
| 15 #include "content/shell/renderer/test_runner/TestInterfaces.h" | 16 #include "content/shell/renderer/test_runner/TestInterfaces.h" |
| 16 #include "content/shell/renderer/test_runner/TestPlugin.h" | 17 #include "content/shell/renderer/test_runner/TestPlugin.h" |
| 17 #include "content/shell/renderer/test_runner/TestRunner.h" | 18 #include "content/shell/renderer/test_runner/TestRunner.h" |
| 18 #include "content/shell/renderer/test_runner/WebTestDelegate.h" | 19 #include "content/shell/renderer/test_runner/WebTestDelegate.h" |
| 19 #include "content/shell/renderer/test_runner/WebTestInterfaces.h" | 20 #include "content/shell/renderer/test_runner/WebTestInterfaces.h" |
| 20 #include "content/shell/renderer/test_runner/WebTestRunner.h" | 21 #include "content/shell/renderer/test_runner/WebTestRunner.h" |
| 21 #include "content/shell/renderer/test_runner/WebUserMediaClientMock.h" | 22 #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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 845 eventName = "TextRemoved"; | 845 eventName = "TextRemoved"; |
| 846 break; | 846 break; |
| 847 case blink::WebAXEventValueChanged: | 847 case blink::WebAXEventValueChanged: |
| 848 eventName = "ValueChanged"; | 848 eventName = "ValueChanged"; |
| 849 break; | 849 break; |
| 850 default: | 850 default: |
| 851 eventName = "Unknown"; | 851 eventName = "Unknown"; |
| 852 break; | 852 break; |
| 853 } | 853 } |
| 854 | 854 |
| 855 m_testInterfaces->accessibilityController()->NotificationReceived(obj, event
Name); | 855 m_testInterfaces->accessibilityController()->notificationReceived(obj, event
Name); |
| 856 | 856 |
| 857 if (m_testInterfaces->accessibilityController()->ShouldLogAccessibilityEvent
s()) { | 857 if (m_testInterfaces->accessibilityController()->shouldLogAccessibilityEvent
s()) { |
| 858 string message("AccessibilityNotification - "); | 858 string message("AccessibilityNotification - "); |
| 859 message += eventName; | 859 message += eventName; |
| 860 | 860 |
| 861 blink::WebNode node = obj.node(); | 861 blink::WebNode node = obj.node(); |
| 862 if (!node.isNull() && node.isElementNode()) { | 862 if (!node.isNull() && node.isElementNode()) { |
| 863 blink::WebElement element = node.to<blink::WebElement>(); | 863 blink::WebElement element = node.to<blink::WebElement>(); |
| 864 if (element.hasAttribute("id")) { | 864 if (element.hasAttribute("id")) { |
| 865 message += " - id:"; | 865 message += " - id:"; |
| 866 message += element.getAttribute("id").utf8().data(); | 866 message += element.getAttribute("id").utf8().data(); |
| 867 } | 867 } |
| (...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1355 | 1355 |
| 1356 void WebTestProxyBase::resetInputMethod() | 1356 void WebTestProxyBase::resetInputMethod() |
| 1357 { | 1357 { |
| 1358 // If a composition text exists, then we need to let the browser process | 1358 // If a composition text exists, then we need to let the browser process |
| 1359 // to cancel the input method's ongoing composition session. | 1359 // to cancel the input method's ongoing composition session. |
| 1360 if (m_webWidget) | 1360 if (m_webWidget) |
| 1361 m_webWidget->confirmComposition(); | 1361 m_webWidget->confirmComposition(); |
| 1362 } | 1362 } |
| 1363 | 1363 |
| 1364 } | 1364 } |
| OLD | NEW |