Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(155)

Side by Side Diff: Source/testing/runner/WebTestProxy.cpp

Issue 22331005: Clean up accessibility enums for use in Chromium. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Update failing tests, add one missing role Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 #include "TestPlugin.h" 42 #include "TestPlugin.h"
43 #include "TestRunner.h" 43 #include "TestRunner.h"
44 #include "WebUserMediaClientMock.h" 44 #include "WebUserMediaClientMock.h"
45 #include "public/platform/WebCString.h" 45 #include "public/platform/WebCString.h"
46 #include "public/platform/WebURLError.h" 46 #include "public/platform/WebURLError.h"
47 #include "public/platform/WebURLRequest.h" 47 #include "public/platform/WebURLRequest.h"
48 #include "public/platform/WebURLResponse.h" 48 #include "public/platform/WebURLResponse.h"
49 #include "public/testing/WebTestDelegate.h" 49 #include "public/testing/WebTestDelegate.h"
50 #include "public/testing/WebTestInterfaces.h" 50 #include "public/testing/WebTestInterfaces.h"
51 #include "public/testing/WebTestRunner.h" 51 #include "public/testing/WebTestRunner.h"
52 #include "public/web/WebAccessibilityNotification.h" 52 #include "public/web/WebAXTypes.h"
53 #include "public/web/WebAccessibilityObject.h" 53 #include "public/web/WebAccessibilityObject.h"
54 #include "public/web/WebCachedURLRequest.h" 54 #include "public/web/WebCachedURLRequest.h"
55 #include "public/web/WebConsoleMessage.h" 55 #include "public/web/WebConsoleMessage.h"
56 #include "public/web/WebDataSource.h" 56 #include "public/web/WebDataSource.h"
57 #include "public/web/WebDeviceOrientationClientMock.h" 57 #include "public/web/WebDeviceOrientationClientMock.h"
58 #include "public/web/WebDocument.h" 58 #include "public/web/WebDocument.h"
59 #include "public/web/WebElement.h" 59 #include "public/web/WebElement.h"
60 #include "public/web/WebFrame.h" 60 #include "public/web/WebFrame.h"
61 #include "public/web/WebGeolocationClientMock.h" 61 #include "public/web/WebGeolocationClientMock.h"
62 #include "public/web/WebHistoryItem.h" 62 #include "public/web/WebHistoryItem.h"
(...skipping 748 matching lines...) Expand 10 before | Expand all | Expand 10 after
811 { 811 {
812 invalidateAll(); 812 invalidateAll();
813 discardBackingStore(); 813 discardBackingStore();
814 } 814 }
815 815
816 void WebTestProxyBase::didAutoResize(const WebSize&) 816 void WebTestProxyBase::didAutoResize(const WebSize&)
817 { 817 {
818 invalidateAll(); 818 invalidateAll();
819 } 819 }
820 820
821 void WebTestProxyBase::postAccessibilityNotification(const WebKit::WebAccessibil ityObject& obj, WebKit::WebAccessibilityNotification notification) 821 void WebTestProxyBase::postAccessibilityEvent(const WebKit::WebAccessibilityObje ct& obj, WebAXTypes::Event event)
822 { 822 {
823 if (notification == WebKit::WebAccessibilityNotificationFocusedUIElementChan ged) 823 if (event == WebAXTypes::Focus)
824 m_testInterfaces->accessibilityController()->setFocusedElement(obj); 824 m_testInterfaces->accessibilityController()->setFocusedElement(obj);
825 825
826 const char* notificationName; 826 const char* eventName;
827 switch (notification) { 827 switch (event) {
828 case WebKit::WebAccessibilityNotificationActiveDescendantChanged: 828 case WebAXTypes::ActiveDescendantChanged:
829 notificationName = "ActiveDescendantChanged"; 829 eventName = "ActiveDescendantChanged";
830 break; 830 break;
831 case WebKit::WebAccessibilityNotificationAutocorrectionOccured: 831 case WebAXTypes::Alert:
832 notificationName = "AutocorrectionOccured"; 832 eventName = "Alert";
833 break; 833 break;
834 case WebKit::WebAccessibilityNotificationCheckedStateChanged: 834 case WebAXTypes::AriaAttributeChanged:
835 notificationName = "CheckedStateChanged"; 835 eventName = "AriaAttributeChanged";
836 break; 836 break;
837 case WebKit::WebAccessibilityNotificationChildrenChanged: 837 case WebAXTypes::AutocorrectionOccured:
838 notificationName = "ChildrenChanged"; 838 eventName = "AutocorrectionOccured";
839 break; 839 break;
840 case WebKit::WebAccessibilityNotificationFocusedUIElementChanged: 840 case WebAXTypes::Blur:
841 notificationName = "FocusedUIElementChanged"; 841 eventName = "Blur";
842 break; 842 break;
843 case WebKit::WebAccessibilityNotificationLayoutComplete: 843 case WebAXTypes::CheckedStateChanged:
844 notificationName = "LayoutComplete"; 844 eventName = "CheckedStateChanged";
845 break; 845 break;
846 case WebKit::WebAccessibilityNotificationLoadComplete: 846 case WebAXTypes::ChildrenChanged:
847 notificationName = "LoadComplete"; 847 eventName = "ChildrenChanged";
848 break; 848 break;
849 case WebKit::WebAccessibilityNotificationSelectedChildrenChanged: 849 case WebAXTypes::Focus:
850 notificationName = "SelectedChildrenChanged"; 850 eventName = "Focus";
851 break; 851 break;
852 case WebKit::WebAccessibilityNotificationSelectedTextChanged: 852 case WebAXTypes::Hide:
853 notificationName = "SelectedTextChanged"; 853 eventName = "Hide";
854 break; 854 break;
855 case WebKit::WebAccessibilityNotificationValueChanged: 855 case WebAXTypes::InvalidStatusChanged:
856 notificationName = "ValueChanged"; 856 eventName = "InvalidStatusChanged";
857 break; 857 break;
858 case WebKit::WebAccessibilityNotificationScrolledToAnchor: 858 case WebAXTypes::LayoutComplete:
859 notificationName = "ScrolledToAnchor"; 859 eventName = "LayoutComplete";
860 break; 860 break;
861 case WebKit::WebAccessibilityNotificationLiveRegionChanged: 861 case WebAXTypes::LiveRegionChanged:
862 notificationName = "LiveRegionChanged"; 862 eventName = "LiveRegionChanged";
863 break; 863 break;
864 case WebKit::WebAccessibilityNotificationMenuListItemSelected: 864 case WebAXTypes::LoadComplete:
865 notificationName = "MenuListItemSelected"; 865 eventName = "LoadComplete";
866 break; 866 break;
867 case WebKit::WebAccessibilityNotificationMenuListValueChanged: 867 case WebAXTypes::LocationChanged:
868 notificationName = "MenuListValueChanged"; 868 eventName = "LocationChanged";
869 break; 869 break;
870 case WebKit::WebAccessibilityNotificationRowCountChanged: 870 case WebAXTypes::MenuListItemSelected:
871 notificationName = "RowCountChanged"; 871 eventName = "MenuListItemSelected";
872 break; 872 break;
873 case WebKit::WebAccessibilityNotificationRowCollapsed: 873 case WebAXTypes::MenuListValueChanged:
874 notificationName = "RowCollapsed"; 874 eventName = "MenuListValueChanged";
875 break; 875 break;
876 case WebKit::WebAccessibilityNotificationRowExpanded: 876 case WebAXTypes::RowCollapsed:
877 notificationName = "RowExpanded"; 877 eventName = "RowCollapsed";
878 break; 878 break;
879 case WebKit::WebAccessibilityNotificationInvalidStatusChanged: 879 case WebAXTypes::RowCountChanged:
880 notificationName = "InvalidStatusChanged"; 880 eventName = "RowCountChanged";
881 break; 881 break;
882 case WebKit::WebAccessibilityNotificationTextChanged: 882 case WebAXTypes::RowExpanded:
883 notificationName = "TextChanged"; 883 eventName = "RowExpanded";
884 break; 884 break;
885 case WebKit::WebAccessibilityNotificationAriaAttributeChanged: 885 case WebAXTypes::ScrolledToAnchor:
886 notificationName = "AriaAttributeChanged"; 886 eventName = "ScrolledToAnchor";
887 break; 887 break;
888 default: 888 case WebAXTypes::SelectedChildrenChanged:
889 notificationName = "UnknownNotification"; 889 eventName = "SelectedChildrenChanged";
890 break;
891 case WebAXTypes::SelectedTextChanged:
892 eventName = "SelectedTextChanged";
893 break;
894 case WebAXTypes::Show:
895 eventName = "Show";
896 break;
897 case WebAXTypes::TextChanged:
898 eventName = "TextChanged";
899 break;
900 case WebAXTypes::TextInserted:
901 eventName = "TextInserted";
902 break;
903 case WebAXTypes::TextRemoved:
904 eventName = "TextRemoved";
905 break;
906 case WebAXTypes::ValueChanged:
907 eventName = "ValueChanged";
890 break; 908 break;
891 } 909 }
892 910
893 m_testInterfaces->accessibilityController()->notificationReceived(obj, notif icationName); 911 m_testInterfaces->accessibilityController()->notificationReceived(obj, event Name);
894 912
895 if (m_testInterfaces->accessibilityController()->shouldLogAccessibilityEvent s()) { 913 if (m_testInterfaces->accessibilityController()->shouldLogAccessibilityEvent s()) {
896 string message("AccessibilityNotification - "); 914 string message("AccessibilityNotification - ");
897 message += notificationName; 915 message += eventName;
898 916
899 WebKit::WebNode node = obj.node(); 917 WebKit::WebNode node = obj.node();
900 if (!node.isNull() && node.isElementNode()) { 918 if (!node.isNull() && node.isElementNode()) {
901 WebKit::WebElement element = node.to<WebKit::WebElement>(); 919 WebKit::WebElement element = node.to<WebKit::WebElement>();
902 if (element.hasAttribute("id")) { 920 if (element.hasAttribute("id")) {
903 message += " - id:"; 921 message += " - id:";
904 message += element.getAttribute("id").utf8().data(); 922 message += element.getAttribute("id").utf8().data();
905 } 923 }
906 } 924 }
907 925
(...skipping 564 matching lines...) Expand 10 before | Expand all | Expand 10 after
1472 1490
1473 void WebTestProxyBase::resetInputMethod() 1491 void WebTestProxyBase::resetInputMethod()
1474 { 1492 {
1475 // If a composition text exists, then we need to let the browser process 1493 // If a composition text exists, then we need to let the browser process
1476 // to cancel the input method's ongoing composition session. 1494 // to cancel the input method's ongoing composition session.
1477 if (m_webWidget) 1495 if (m_webWidget)
1478 m_webWidget->confirmComposition(); 1496 m_webWidget->confirmComposition();
1479 } 1497 }
1480 1498
1481 } 1499 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698