WebKitTestRunner needs to support accessibility-related DRT APIs
https://bugs.webkit.org/show_bug.cgi?id=42131
Tools:
Reviewed by Beth Dakin.
Port the AX code in DRT to WKTestRunner by using IDL.
* DumpRenderTree/AccessibilityUIElement.cpp:
(horizontalScrollbarCallback):
(verticalScrollbarCallback):
(AccessibilityUIElement::horizontalScrollbar):
(AccessibilityUIElement::verticalScrollbar):
(AccessibilityUIElement::getJSClass):
* DumpRenderTree/AccessibilityUIElement.h:
* DumpRenderTree/mac/AccessibilityUIElementMac.mm:
(AccessibilityUIElement::horizontalScrollbar):
(AccessibilityUIElement::verticalScrollbar):
* WebKitTestRunner/DerivedSources.make:
* WebKitTestRunner/GNUmakefile.am:
* WebKitTestRunner/InjectedBundle/AccessibilityController.cpp: Added.
(WTR::AccessibilityController::create):
(WTR::AccessibilityController::AccessibilityController):
(WTR::AccessibilityController::~AccessibilityController):
(WTR::AccessibilityController::makeWindowObject):
(WTR::AccessibilityController::wrapperClass):
(WTR::AccessibilityController::rootElement):
(WTR::AccessibilityController::focusedElement):
(WTR::AccessibilityController::elementAtPoint):
* WebKitTestRunner/InjectedBundle/AccessibilityController.h: Added.
(WTR::AccessibilityController::logFocusEvents):
(WTR::AccessibilityController::logValueChangeEvents):
(WTR::AccessibilityController::logScrollingStartEvents):
(WTR::AccessibilityController::logAccessibilityEvents):
(WTR::AccessibilityController::addNotificationListener):
(WTR::AccessibilityController::notificationReceived):
(WTR::AccessibilityController::resetToConsistentState):
* WebKitTestRunner/InjectedBundle/AccessibilityTextMarker.cpp: Added.
(WTR::AccessibilityTextMarker::create):
(WTR::AccessibilityTextMarker::AccessibilityTextMarker):
(WTR::AccessibilityTextMarker::~AccessibilityTextMarker):
(WTR::AccessibilityTextMarker::platformTextMarker):
(WTR::AccessibilityTextMarker::wrapperClass):
* WebKitTestRunner/InjectedBundle/AccessibilityTextMarker.h: Added.
(WTR::AccessibilityTextMarker::isEqual):
* WebKitTestRunner/InjectedBundle/AccessibilityTextMarkerRange.cpp: Added.
(WTR::AccessibilityTextMarkerRange::create):
(WTR::AccessibilityTextMarkerRange::AccessibilityTextMarkerRange):
(WTR::AccessibilityTextMarkerRange::~AccessibilityTextMarkerRange):
(WTR::AccessibilityTextMarkerRange::platformTextMarkerRange):
(WTR::AccessibilityTextMarkerRange::wrapperClass):
* WebKitTestRunner/InjectedBundle/AccessibilityTextMarkerRange.h: Added.
(WTR::AccessibilityTextMarkerRange::isEqual):
* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp: Added.
(WTR::AccessibilityUIElement::create):
(WTR::AccessibilityUIElement::wrapperClass):
(WTR::AccessibilityUIElement::isValid):
(WTR::AccessibilityUIElement::AccessibilityUIElement):
(WTR::AccessibilityUIElement::~AccessibilityUIElement):
(WTR::AccessibilityUIElement::isEqual):
(WTR::AccessibilityUIElement::elementAtPoint):
(WTR::AccessibilityUIElement::childAtIndex):
(WTR::AccessibilityUIElement::indexOfChild):
(WTR::AccessibilityUIElement::childrenCount):
(WTR::AccessibilityUIElement::titleUIElement):
(WTR::AccessibilityUIElement::parentElement):
(WTR::AccessibilityUIElement::takeFocus):
(WTR::AccessibilityUIElement::takeSelection):
(WTR::AccessibilityUIElement::addSelection):
(WTR::AccessibilityUIElement::removeSelection):
(WTR::AccessibilityUIElement::allAttributes):
(WTR::AccessibilityUIElement::attributesOfLinkedUIElements):
(WTR::AccessibilityUIElement::linkedUIElementAtIndex):
(WTR::AccessibilityUIElement::attributesOfDocumentLinks):
(WTR::AccessibilityUIElement::attributesOfChildren):
(WTR::AccessibilityUIElement::parameterizedAttributeNames):
(WTR::AccessibilityUIElement::increment):
(WTR::AccessibilityUIElement::decrement):
(WTR::AccessibilityUIElement::showMenu):
(WTR::AccessibilityUIElement::press):
(WTR::AccessibilityUIElement::stringAttributeValue):
(WTR::AccessibilityUIElement::uiElementAttributeValue):
(WTR::AccessibilityUIElement::numberAttributeValue):
(WTR::AccessibilityUIElement::boolAttributeValue):
(WTR::AccessibilityUIElement::isAttributeSupported):
(WTR::AccessibilityUIElement::isAttributeSettable):
(WTR::AccessibilityUIElement::isActionSupported):
(WTR::AccessibilityUIElement::role):
(WTR::AccessibilityUIElement::subrole):
(WTR::AccessibilityUIElement::roleDescription):
(WTR::AccessibilityUIElement::title):
(WTR::AccessibilityUIElement::description):
(WTR::AccessibilityUIElement::language):
(WTR::AccessibilityUIElement::stringValue):
(WTR::AccessibilityUIElement::accessibilityValue):
(WTR::AccessibilityUIElement::helpText):
(WTR::AccessibilityUIElement::orientation):
(WTR::AccessibilityUIElement::x):
(WTR::AccessibilityUIElement::y):
(WTR::AccessibilityUIElement::width):
(WTR::AccessibilityUIElement::height):
(WTR::AccessibilityUIElement::intValue):
(WTR::AccessibilityUIElement::minValue):
(WTR::AccessibilityUIElement::maxValue):
(WTR::AccessibilityUIElement::valueDescription):
(WTR::AccessibilityUIElement::insertionPointLineNumber):
(WTR::AccessibilityUIElement::selectedTextRange):
(WTR::AccessibilityUIElement::isEnabled):
(WTR::AccessibilityUIElement::isRequired):
(WTR::AccessibilityUIElement::isFocused):
(WTR::AccessibilityUIElement::isFocusable):
(WTR::AccessibilityUIElement::isSelected):
(WTR::AccessibilityUIElement::isSelectable):
(WTR::AccessibilityUIElement::isMultiSelectable):
(WTR::AccessibilityUIElement::setSelectedChild):
(WTR::AccessibilityUIElement::selectedChildrenCount):
(WTR::AccessibilityUIElement::selectedChildAtIndex):
(WTR::AccessibilityUIElement::isExpanded):
(WTR::AccessibilityUIElement::isChecked):
(WTR::AccessibilityUIElement::isVisible):
(WTR::AccessibilityUIElement::isOffScreen):
(WTR::AccessibilityUIElement::isCollapsed):
(WTR::AccessibilityUIElement::isIgnored):
(WTR::AccessibilityUIElement::hasPopup):
(WTR::AccessibilityUIElement::hierarchicalLevel):
(WTR::AccessibilityUIElement::clickPointX):
(WTR::AccessibilityUIElement::clickPointY):
(WTR::AccessibilityUIElement::documentEncoding):
(WTR::AccessibilityUIElement::documentURI):
(WTR::AccessibilityUIElement::url):
(WTR::AccessibilityUIElement::speak):
(WTR::AccessibilityUIElement::attributesOfColumnHeaders):
(WTR::AccessibilityUIElement::attributesOfRowHeaders):
(WTR::AccessibilityUIElement::attributesOfColumns):
(WTR::AccessibilityUIElement::attributesOfRows):
(WTR::AccessibilityUIElement::attributesOfVisibleCells):
(WTR::AccessibilityUIElement::attributesOfHeader):
(WTR::AccessibilityUIElement::indexInTable):
(WTR::AccessibilityUIElement::rowIndexRange):
(WTR::AccessibilityUIElement::columnIndexRange):
(WTR::AccessibilityUIElement::rowCount):
(WTR::AccessibilityUIElement::columnCount):
(WTR::AccessibilityUIElement::selectedRowAtIndex):
(WTR::AccessibilityUIElement::disclosedByRow):
(WTR::AccessibilityUIElement::disclosedRowAtIndex):
(WTR::AccessibilityUIElement::ariaOwnsElementAtIndex):
(WTR::AccessibilityUIElement::ariaFlowToElementAtIndex):
(WTR::AccessibilityUIElement::ariaIsGrabbed):
(WTR::AccessibilityUIElement::ariaDropEffects):
(WTR::AccessibilityUIElement::lineForIndex):
(WTR::AccessibilityUIElement::rangeForLine):
(WTR::AccessibilityUIElement::boundsForRange):
(WTR::AccessibilityUIElement::setSelectedTextRange):
(WTR::AccessibilityUIElement::stringForRange):
(WTR::AccessibilityUIElement::attributedStringForRange):
(WTR::AccessibilityUIElement::attributedStringRangeIsMisspelled):
(WTR::AccessibilityUIElement::uiElementForSearchPredicate):
(WTR::AccessibilityUIElement::cellForColumnAndRow):
(WTR::AccessibilityUIElement::horizontalScrollbar):
(WTR::AccessibilityUIElement::verticalScrollbar):
(WTR::AccessibilityUIElement::addNotificationListener):
(WTR::AccessibilityUIElement::removeNotificationListener):
(WTR::AccessibilityUIElement::textMarkerRangeForElement):
(WTR::AccessibilityUIElement::textMarkerRangeLength):
(WTR::AccessibilityUIElement::textMarkerRangeForMarkers):
(WTR::AccessibilityUIElement::startTextMarkerForTextMarkerRange):
(WTR::AccessibilityUIElement::endTextMarkerForTextMarkerRange):
(WTR::AccessibilityUIElement::accessibilityElementForTextMarker):
(WTR::AccessibilityUIElement::textMarkerForPoint):
(WTR::AccessibilityUIElement::previousTextMarker):
(WTR::AccessibilityUIElement::nextTextMarker):
(WTR::AccessibilityUIElement::stringForTextMarkerRange):
* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h: Added.
(WTR::AccessibilityUIElement::platformUIElement):
* WebKitTestRunner/InjectedBundle/Bindings/AccessibilityController.idl: Added.
* WebKitTestRunner/InjectedBundle/Bindings/AccessibilityTextMarker.idl: Added.
* WebKitTestRunner/InjectedBundle/Bindings/AccessibilityTextMarkerRange.idl: Added.
* WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl: Added.
* WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl:
* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::beginTesting):
* WebKitTestRunner/InjectedBundle/InjectedBundle.h:
(WTR::InjectedBundle::accessibilityController):
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::didClearWindowForFrame):
* WebKitTestRunner/InjectedBundle/LayoutTestController.h:
* WebKitTestRunner/InjectedBundle/gtk/LayoutTestControllerGtk.cpp:
(WTR::LayoutTestController::platformName):
* WebKitTestRunner/InjectedBundle/mac/AccessibilityTextMarkerMac.mm: Added.
(WTR::AccessibilityTextMarker::isEqual):
* WebKitTestRunner/InjectedBundle/mac/AccessibilityTextMarkerRangeMac.mm: Added.
(WTR::AccessibilityTextMarkerRange::isEqual):
* WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm: Added.
(+[NSString stringWithJSStringRef:]):
(-[NSString createJSStringRef]):
(-[AccessibilityNotificationHandler initWithPlatformElement:]):
(-[AccessibilityNotificationHandler dealloc]):
(-[AccessibilityNotificationHandler _notificationReceived:]):
(-[AccessibilityNotificationHandler setCallback:]):
(WTR::AccessibilityUIElement::AccessibilityUIElement):
(WTR::AccessibilityUIElement::~AccessibilityUIElement):
(WTR::AccessibilityUIElement::isEqual):
(WTR::descriptionOfValue):
(WTR::attributesOfElement):
(WTR::concatenateAttributeAndValue):
(WTR::convertNSArrayToVector):
(WTR::descriptionOfElements):
(WTR::AccessibilityUIElement::getLinkedUIElements):
(WTR::AccessibilityUIElement::getDocumentLinks):
(WTR::AccessibilityUIElement::getChildren):
(WTR::AccessibilityUIElement::getChildrenWithRange):
(WTR::AccessibilityUIElement::childrenCount):
(WTR::AccessibilityUIElement::elementAtPoint):
(WTR::AccessibilityUIElement::indexOfChild):
(WTR::AccessibilityUIElement::childAtIndex):
(WTR::AccessibilityUIElement::linkedUIElementAtIndex):
(WTR::AccessibilityUIElement::ariaOwnsElementAtIndex):
(WTR::AccessibilityUIElement::ariaFlowToElementAtIndex):
(WTR::AccessibilityUIElement::disclosedRowAtIndex):
(WTR::AccessibilityUIElement::selectedChildAtIndex):
(WTR::AccessibilityUIElement::selectedChildrenCount):
(WTR::AccessibilityUIElement::selectedRowAtIndex):
(WTR::AccessibilityUIElement::titleUIElement):
(WTR::AccessibilityUIElement::parentElement):
(WTR::AccessibilityUIElement::disclosedByRow):
(WTR::AccessibilityUIElement::attributesOfLinkedUIElements):
(WTR::AccessibilityUIElement::attributesOfDocumentLinks):
(WTR::AccessibilityUIElement::attributesOfChildren):
(WTR::AccessibilityUIElement::allAttributes):
(WTR::AccessibilityUIElement::stringAttributeValue):
(WTR::AccessibilityUIElement::numberAttributeValue):
(WTR::AccessibilityUIElement::uiElementAttributeValue):
(WTR::AccessibilityUIElement::boolAttributeValue):
(WTR::AccessibilityUIElement::isAttributeSettable):
(WTR::AccessibilityUIElement::isAttributeSupported):
(WTR::AccessibilityUIElement::parameterizedAttributeNames):
(WTR::AccessibilityUIElement::role):
(WTR::AccessibilityUIElement::subrole):
(WTR::AccessibilityUIElement::roleDescription):
(WTR::AccessibilityUIElement::title):
(WTR::AccessibilityUIElement::description):
(WTR::AccessibilityUIElement::orientation):
(WTR::AccessibilityUIElement::stringValue):
(WTR::AccessibilityUIElement::language):
(WTR::AccessibilityUIElement::helpText):
(WTR::AccessibilityUIElement::x):
(WTR::AccessibilityUIElement::y):
(WTR::AccessibilityUIElement::width):
(WTR::AccessibilityUIElement::height):
(WTR::AccessibilityUIElement::clickPointX):
(WTR::AccessibilityUIElement::clickPointY):
(WTR::AccessibilityUIElement::intValue):
(WTR::AccessibilityUIElement::minValue):
(WTR::AccessibilityUIElement::maxValue):
(WTR::AccessibilityUIElement::valueDescription):
(WTR::AccessibilityUIElement::insertionPointLineNumber):
(WTR::AccessibilityUIElement::isActionSupported):
(WTR::AccessibilityUIElement::isEnabled):
(WTR::AccessibilityUIElement::isRequired):
(WTR::AccessibilityUIElement::isFocused):
(WTR::AccessibilityUIElement::isSelected):
(WTR::AccessibilityUIElement::isExpanded):
(WTR::AccessibilityUIElement::isChecked):
(WTR::AccessibilityUIElement::hierarchicalLevel):
(WTR::AccessibilityUIElement::speak):
(WTR::AccessibilityUIElement::ariaIsGrabbed):
(WTR::AccessibilityUIElement::ariaDropEffects):
(WTR::AccessibilityUIElement::lineForIndex):
(WTR::AccessibilityUIElement::rangeForLine):
(WTR::AccessibilityUIElement::boundsForRange):
(WTR::AccessibilityUIElement::stringForRange):
(WTR::AccessibilityUIElement::attributedStringForRange):
(WTR::AccessibilityUIElement::attributedStringRangeIsMisspelled):
(WTR::AccessibilityUIElement::uiElementForSearchPredicate):
(WTR::AccessibilityUIElement::attributesOfColumnHeaders):
(WTR::AccessibilityUIElement::attributesOfRowHeaders):
(WTR::AccessibilityUIElement::attributesOfColumns):
(WTR::AccessibilityUIElement::attributesOfRows):
(WTR::AccessibilityUIElement::attributesOfVisibleCells):
(WTR::AccessibilityUIElement::attributesOfHeader):
(WTR::AccessibilityUIElement::rowCount):
(WTR::AccessibilityUIElement::columnCount):
(WTR::AccessibilityUIElement::indexInTable):
(WTR::AccessibilityUIElement::rowIndexRange):
(WTR::AccessibilityUIElement::columnIndexRange):
(WTR::AccessibilityUIElement::cellForColumnAndRow):
(WTR::AccessibilityUIElement::horizontalScrollbar):
(WTR::AccessibilityUIElement::verticalScrollbar):
(WTR::AccessibilityUIElement::selectedTextRange):
(WTR::AccessibilityUIElement::setSelectedTextRange):
(WTR::AccessibilityUIElement::increment):
(WTR::AccessibilityUIElement::decrement):
(WTR::AccessibilityUIElement::showMenu):
(WTR::AccessibilityUIElement::press):
(WTR::AccessibilityUIElement::setSelectedChild):
(WTR::AccessibilityUIElement::accessibilityValue):
(WTR::AccessibilityUIElement::documentEncoding):
(WTR::AccessibilityUIElement::documentURI):
(WTR::AccessibilityUIElement::url):
(WTR::AccessibilityUIElement::addNotificationListener):
(WTR::AccessibilityUIElement::removeNotificationListener):
(WTR::AccessibilityUIElement::isFocusable):
(WTR::AccessibilityUIElement::isSelectable):
(WTR::AccessibilityUIElement::isMultiSelectable):
(WTR::AccessibilityUIElement::isVisible):
(WTR::AccessibilityUIElement::isOffScreen):
(WTR::AccessibilityUIElement::isCollapsed):
(WTR::AccessibilityUIElement::isIgnored):
(WTR::AccessibilityUIElement::hasPopup):
(WTR::AccessibilityUIElement::takeFocus):
(WTR::AccessibilityUIElement::takeSelection):
(WTR::AccessibilityUIElement::addSelection):
(WTR::AccessibilityUIElement::removeSelection):
(WTR::AccessibilityUIElement::textMarkerRangeForElement):
(WTR::AccessibilityUIElement::textMarkerRangeLength):
(WTR::AccessibilityUIElement::previousTextMarker):
(WTR::AccessibilityUIElement::nextTextMarker):
(WTR::AccessibilityUIElement::stringForTextMarkerRange):
(WTR::AccessibilityUIElement::textMarkerRangeForMarkers):
(WTR::AccessibilityUIElement::startTextMarkerForTextMarkerRange):
(WTR::AccessibilityUIElement::endTextMarkerForTextMarkerRange):
(WTR::AccessibilityUIElement::textMarkerForPoint):
(WTR::AccessibilityUIElement::accessibilityElementForTextMarker):
* WebKitTestRunner/InjectedBundle/mac/LayoutTestControllerMac.mm:
(WTR::LayoutTestController::platformName):
* WebKitTestRunner/InjectedBundle/qt/LayoutTestControllerQt.cpp:
(WTR::LayoutTestController::platformName):
* WebKitTestRunner/InjectedBundle/win/LayoutTestControllerWin.cpp:
(WTR::LayoutTestController::platformName):
* WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
* WebKitTestRunner/win/InjectedBundle.vcproj:
LayoutTests:
Cleanup tests and skip lists so that accessibility tests can run
in WK2. This mostly involved handling returned elements that might be nil,
something that did not happen in DRT.
Reviewed by Beth Dakin.
* accessibility/aria-labelledby-overrides-label-expected.txt:
* accessibility/aria-labelledby-overrides-label.html:
* accessibility/non-data-table-cell-title-ui-element.html:
* accessibility/th-as-title-ui.html:
Make sure a nil titleUIElement is accounted for in these tests.
* platform/gtk-wk2/Skipped:
* platform/mac/accessibility/aria-expanded-notifications-expected.txt:
* platform/mac/accessibility/aria-expanded-notifications.html:
* platform/mac/accessibility/aria-invalid-expected.txt:
* platform/mac/accessibility/aria-invalid.html:
* platform/mac/accessibility/aria-liveregions-addedelement-expected.txt:
* platform/mac/accessibility/aria-liveregions-addedelement.html:
* platform/mac/accessibility/aria-liveregions-changedalt-expected.txt:
* platform/mac/accessibility/aria-liveregions-changedalt.html:
* platform/mac/accessibility/aria-liveregions-changedtext-expected.txt:
* platform/mac/accessibility/aria-liveregions-changedtext.html:
* platform/mac/accessibility/aria-liveregions-removedelement-expected.txt:
* platform/mac/accessibility/aria-liveregions-removedelement.html:
All the preceeding layout tests use alert() to output the results of notifications. This
is causing re-ordering issues on WK2, so I've moved them all to output that notification
data to a separate element from "console".
* platform/mac/accessibility/html-section-elements-expected.txt:
* platform/mac/accessibility/html-section-elements.html:
Remove nil element access that is unnecessary.
* platform/mac/accessibility/html-slider-indicator-expected.txt:
* platform/mac/accessibility/html-slider-indicator.html:
* platform/mac/accessibility/search-predicate.html:
Add an alt tag to <img> so that it always shows up in the AX tree.
* platform/mac/accessibility/selection-value-changes-for-aria-textbox.html:
* platform/mac/accessibility/textbox-role-reports-notifications-expected.txt:
Remove the notification listener properly (was causing flakiness).
* platform/mac/accessibility/textbox-role-reports-notifications.html:
* platform/mac/accessibility/update-children-when-aria-role-changes-expected.txt:
* platform/mac/accessibility/update-children-when-aria-role-changes.html:
Account for when element's returned are nil.
* platform/win-wk2/Skipped:
Skip all accessibility tests on win.
* platform/wk2/Skipped:
Skip all accessibility tests on gtk.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@100488 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/platform/mac/accessibility/aria-invalid-expected.txt b/LayoutTests/platform/mac/accessibility/aria-invalid-expected.txt
index fdd8039..b91d525 100644
--- a/LayoutTests/platform/mac/accessibility/aria-invalid-expected.txt
+++ b/LayoutTests/platform/mac/accessibility/aria-invalid-expected.txt
@@ -1,4 +1,3 @@
-ALERT: Notification received successfully.
This tests that aria-invalid causes the right attribute to be returned and it ensures a notification is sent when it changes.
@@ -13,4 +12,4 @@
PASS successfullyParsed is true
TEST COMPLETE
-
+Notification received successfully.