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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
839 eventName = "TextInserted"; | 839 eventName = "TextInserted"; |
840 break; | 840 break; |
841 case blink::WebAXEventTextRemoved: | 841 case blink::WebAXEventTextRemoved: |
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 } | 847 } |
848 | 848 |
849 m_testInterfaces->accessibilityController()->notificationReceived(obj, event
Name); | 849 m_testInterfaces->accessibilityController()->NotificationReceived(obj, event
Name); |
850 | 850 |
851 if (m_testInterfaces->accessibilityController()->shouldLogAccessibilityEvent
s()) { | 851 if (m_testInterfaces->accessibilityController()->ShouldLogAccessibilityEvent
s()) { |
852 string message("AccessibilityNotification - "); | 852 string message("AccessibilityNotification - "); |
853 message += eventName; | 853 message += eventName; |
854 | 854 |
855 blink::WebNode node = obj.node(); | 855 blink::WebNode node = obj.node(); |
856 if (!node.isNull() && node.isElementNode()) { | 856 if (!node.isNull() && node.isElementNode()) { |
857 blink::WebElement element = node.to<blink::WebElement>(); | 857 blink::WebElement element = node.to<blink::WebElement>(); |
858 if (element.hasAttribute("id")) { | 858 if (element.hasAttribute("id")) { |
859 message += " - id:"; | 859 message += " - id:"; |
860 message += element.getAttribute("id").utf8().data(); | 860 message += element.getAttribute("id").utf8().data(); |
861 } | 861 } |
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1349 | 1349 |
1350 void WebTestProxyBase::resetInputMethod() | 1350 void WebTestProxyBase::resetInputMethod() |
1351 { | 1351 { |
1352 // If a composition text exists, then we need to let the browser process | 1352 // If a composition text exists, then we need to let the browser process |
1353 // to cancel the input method's ongoing composition session. | 1353 // to cancel the input method's ongoing composition session. |
1354 if (m_webWidget) | 1354 if (m_webWidget) |
1355 m_webWidget->confirmComposition(); | 1355 m_webWidget->confirmComposition(); |
1356 } | 1356 } |
1357 | 1357 |
1358 } | 1358 } |
OLD | NEW |