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

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: Add forgotten file back Created 7 years, 3 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/WebAXEnums.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 758 matching lines...) Expand 10 before | Expand all | Expand 10 after
821 { 821 {
822 invalidateAll(); 822 invalidateAll();
823 discardBackingStore(); 823 discardBackingStore();
824 } 824 }
825 825
826 void WebTestProxyBase::didAutoResize(const WebSize&) 826 void WebTestProxyBase::didAutoResize(const WebSize&)
827 { 827 {
828 invalidateAll(); 828 invalidateAll();
829 } 829 }
830 830
831 void WebTestProxyBase::postAccessibilityNotification(const WebKit::WebAccessibil ityObject& obj, WebKit::WebAccessibilityNotification notification) 831 void WebTestProxyBase::postAccessibilityEvent(const WebKit::WebAccessibilityObje ct& obj, WebKit::WebAXEvent event)
832 { 832 {
833 if (notification == WebKit::WebAccessibilityNotificationFocusedUIElementChan ged) 833 if (event == WebKit::WebAXEventFocus)
834 m_testInterfaces->accessibilityController()->setFocusedElement(obj); 834 m_testInterfaces->accessibilityController()->setFocusedElement(obj);
835 835
836 const char* notificationName; 836 const char* eventName;
837 switch (notification) { 837 switch (event) {
838 case WebKit::WebAccessibilityNotificationActiveDescendantChanged: 838 case WebKit::WebAXEventActiveDescendantChanged:
839 notificationName = "ActiveDescendantChanged"; 839 eventName = "ActiveDescendantChanged";
840 break; 840 break;
841 case WebKit::WebAccessibilityNotificationAutocorrectionOccured: 841 case WebKit::WebAXEventAlert:
842 notificationName = "AutocorrectionOccured"; 842 eventName = "Alert";
843 break; 843 break;
844 case WebKit::WebAccessibilityNotificationCheckedStateChanged: 844 case WebKit::WebAXEventAriaAttributeChanged:
845 notificationName = "CheckedStateChanged"; 845 eventName = "AriaAttributeChanged";
846 break; 846 break;
847 case WebKit::WebAccessibilityNotificationChildrenChanged: 847 case WebKit::WebAXEventAutocorrectionOccured:
848 notificationName = "ChildrenChanged"; 848 eventName = "AutocorrectionOccured";
849 break; 849 break;
850 case WebKit::WebAccessibilityNotificationFocusedUIElementChanged: 850 case WebKit::WebAXEventBlur:
851 notificationName = "FocusedUIElementChanged"; 851 eventName = "Blur";
852 break; 852 break;
853 case WebKit::WebAccessibilityNotificationLayoutComplete: 853 case WebKit::WebAXEventCheckedStateChanged:
854 notificationName = "LayoutComplete"; 854 eventName = "CheckedStateChanged";
855 break; 855 break;
856 case WebKit::WebAccessibilityNotificationLoadComplete: 856 case WebKit::WebAXEventChildrenChanged:
857 notificationName = "LoadComplete"; 857 eventName = "ChildrenChanged";
858 break; 858 break;
859 case WebKit::WebAccessibilityNotificationSelectedChildrenChanged: 859 case WebKit::WebAXEventFocus:
860 notificationName = "SelectedChildrenChanged"; 860 eventName = "Focus";
861 break; 861 break;
862 case WebKit::WebAccessibilityNotificationSelectedTextChanged: 862 case WebKit::WebAXEventHide:
863 notificationName = "SelectedTextChanged"; 863 eventName = "Hide";
864 break; 864 break;
865 case WebKit::WebAccessibilityNotificationValueChanged: 865 case WebKit::WebAXEventInvalidStatusChanged:
866 notificationName = "ValueChanged"; 866 eventName = "InvalidStatusChanged";
867 break; 867 break;
868 case WebKit::WebAccessibilityNotificationScrolledToAnchor: 868 case WebKit::WebAXEventLayoutComplete:
869 notificationName = "ScrolledToAnchor"; 869 eventName = "LayoutComplete";
870 break; 870 break;
871 case WebKit::WebAccessibilityNotificationLiveRegionChanged: 871 case WebKit::WebAXEventLiveRegionChanged:
872 notificationName = "LiveRegionChanged"; 872 eventName = "LiveRegionChanged";
873 break; 873 break;
874 case WebKit::WebAccessibilityNotificationMenuListItemSelected: 874 case WebKit::WebAXEventLoadComplete:
875 notificationName = "MenuListItemSelected"; 875 eventName = "LoadComplete";
876 break; 876 break;
877 case WebKit::WebAccessibilityNotificationMenuListValueChanged: 877 case WebKit::WebAXEventLocationChanged:
878 notificationName = "MenuListValueChanged"; 878 eventName = "LocationChanged";
879 break; 879 break;
880 case WebKit::WebAccessibilityNotificationRowCountChanged: 880 case WebKit::WebAXEventMenuListItemSelected:
881 notificationName = "RowCountChanged"; 881 eventName = "MenuListItemSelected";
882 break; 882 break;
883 case WebKit::WebAccessibilityNotificationRowCollapsed: 883 case WebKit::WebAXEventMenuListValueChanged:
884 notificationName = "RowCollapsed"; 884 eventName = "MenuListValueChanged";
885 break; 885 break;
886 case WebKit::WebAccessibilityNotificationRowExpanded: 886 case WebKit::WebAXEventRowCollapsed:
887 notificationName = "RowExpanded"; 887 eventName = "RowCollapsed";
888 break; 888 break;
889 case WebKit::WebAccessibilityNotificationInvalidStatusChanged: 889 case WebKit::WebAXEventRowCountChanged:
890 notificationName = "InvalidStatusChanged"; 890 eventName = "RowCountChanged";
891 break; 891 break;
892 case WebKit::WebAccessibilityNotificationTextChanged: 892 case WebKit::WebAXEventRowExpanded:
893 notificationName = "TextChanged"; 893 eventName = "RowExpanded";
894 break; 894 break;
895 case WebKit::WebAccessibilityNotificationAriaAttributeChanged: 895 case WebKit::WebAXEventScrolledToAnchor:
896 notificationName = "AriaAttributeChanged"; 896 eventName = "ScrolledToAnchor";
897 break; 897 break;
898 default: 898 case WebKit::WebAXEventSelectedChildrenChanged:
899 notificationName = "UnknownNotification"; 899 eventName = "SelectedChildrenChanged";
900 break;
901 case WebKit::WebAXEventSelectedTextChanged:
902 eventName = "SelectedTextChanged";
903 break;
904 case WebKit::WebAXEventShow:
905 eventName = "Show";
906 break;
907 case WebKit::WebAXEventTextChanged:
908 eventName = "TextChanged";
909 break;
910 case WebKit::WebAXEventTextInserted:
911 eventName = "TextInserted";
912 break;
913 case WebKit::WebAXEventTextRemoved:
914 eventName = "TextRemoved";
915 break;
916 case WebKit::WebAXEventValueChanged:
917 eventName = "ValueChanged";
900 break; 918 break;
901 } 919 }
902 920
903 m_testInterfaces->accessibilityController()->notificationReceived(obj, notif icationName); 921 m_testInterfaces->accessibilityController()->notificationReceived(obj, event Name);
904 922
905 if (m_testInterfaces->accessibilityController()->shouldLogAccessibilityEvent s()) { 923 if (m_testInterfaces->accessibilityController()->shouldLogAccessibilityEvent s()) {
906 string message("AccessibilityNotification - "); 924 string message("AccessibilityNotification - ");
907 message += notificationName; 925 message += eventName;
908 926
909 WebKit::WebNode node = obj.node(); 927 WebKit::WebNode node = obj.node();
910 if (!node.isNull() && node.isElementNode()) { 928 if (!node.isNull() && node.isElementNode()) {
911 WebKit::WebElement element = node.to<WebKit::WebElement>(); 929 WebKit::WebElement element = node.to<WebKit::WebElement>();
912 if (element.hasAttribute("id")) { 930 if (element.hasAttribute("id")) {
913 message += " - id:"; 931 message += " - id:";
914 message += element.getAttribute("id").utf8().data(); 932 message += element.getAttribute("id").utf8().data();
915 } 933 }
916 } 934 }
917 935
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after
1485 1503
1486 void WebTestProxyBase::resetInputMethod() 1504 void WebTestProxyBase::resetInputMethod()
1487 { 1505 {
1488 // If a composition text exists, then we need to let the browser process 1506 // If a composition text exists, then we need to let the browser process
1489 // to cancel the input method's ongoing composition session. 1507 // to cancel the input method's ongoing composition session.
1490 if (m_webWidget) 1508 if (m_webWidget)
1491 m_webWidget->confirmComposition(); 1509 m_webWidget->confirmComposition();
1492 } 1510 }
1493 1511
1494 } 1512 }
OLDNEW
« no previous file with comments | « Source/testing/runner/AccessibilityUIElementChromium.cpp ('k') | Source/web/AssertMatchingEnums.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698