AX: Add client-side accessibility testing support to enable writing site isolation tests#57372
Closed
minorninth wants to merge 1 commit intoWebKit:mainfrom
Conversation
Collaborator
|
EWS run on previous version of this PR (hash 428a278) Details |
428a278 to
369e552
Compare
Collaborator
|
EWS run on previous version of this PR (hash 369e552) Details |
369e552 to
fb2bcbb
Compare
Collaborator
|
EWS run on previous version of this PR (hash fb2bcbb) Details |
fb2bcbb to
6a328e5
Compare
Collaborator
|
EWS run on previous version of this PR (hash 6a328e5) Details |
6a328e5 to
48905e9
Compare
Collaborator
|
EWS run on previous version of this PR (hash 48905e9) Details |
48905e9 to
f1a7865
Compare
Collaborator
|
EWS run on previous version of this PR (hash f1a7865) Details |
f1a7865 to
feb5172
Compare
Collaborator
|
EWS run on previous version of this PR (hash feb5172) Details |
feb5172 to
0bd9215
Compare
Collaborator
|
EWS run on previous version of this PR (hash 0bd9215) Details |
…ite isolation tests rdar://169048334 https://bugs.webkit.org/show_bug.cgi?id=306382 Reviewed by NOBODY (OOPS!). Enables using Mac client-side accessibility APIs (e.g. AXUIElementCopyAttributeValue, used by clients like VoiceOver), in accessibility layout tests, which will allow us to test that accessibility APIs work correctly across site isolation boundaries. This adds a new subclass of AccessibilityUIElement, used to represent each element in an accessibility layout test. When this class is chosen, the client-side accessibility API is used to explore the accessibility tree, rather than calling accessibility APIs in WebCore directly. This can't be done from the web content process due to sandboxing, so instead we send an IPC to the main WebKitTestRunner process and have it call the APIs there. Each AXUIElement is stored in a map and represented by an opaque token. Because the JavaScript API is blocked on an IPC to the main process, and the main process's accessibility call blocks on an IPC to the web content process, this only works if isolated tree mode is enabled, because that uses a secondary accessibility thread. This initial patch just starts with a very simple layout test to demonstrate usage, and we will follow up with site isolation tests. Test: accessibility/mac/client/button.html * LayoutTests/accessibility/mac/client/README.md: Added. * LayoutTests/accessibility/mac/client/button-expected.txt: Added. * LayoutTests/accessibility/mac/client/button.html: Added. * LayoutTests/platform/mac/TestExpectations: * Source/WebCore/testing/js/WebCoreTestSupport.cpp: (WebCoreTestSupport::setAccessibilityIsolatedTreeEnabled): * Source/WebCore/testing/js/WebCoreTestSupport.h: * Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _remoteAccessibilityChildToken]): * Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h: * Source/WebKit/UIProcess/mac/WebViewImpl.h: * Source/WebKit/UIProcess/mac/WebViewImpl.mm: (WebKit::WebViewImpl::remoteAccessibilityChildToken): * Tools/WebKitTestRunner/Configurations/WebKitTestRunner-internal.entitlements: * Tools/WebKitTestRunner/InjectedBundle/AccessibilityController.cpp: (WTR::AccessibilityController::setClientAccessibilityMode): (WTR::AccessibilityController::rootElement): (WTR::AccessibilityController::platformInitializeClientAccessibility): * Tools/WebKitTestRunner/InjectedBundle/AccessibilityController.h: (WTR::AccessibilityController::clientAccessibilityModeEnabled const): * Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp: * Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityController.idl: * Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityControllerMac.mm: (WTR::AccessibilityController::updateIsolatedTreeMode): (WTR::AccessibilityController::platformInitializeClientAccessibility): * Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementClientMac.h: Added. * Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementClientMac.mm: Added. (WTR::axGetRoot): (WTR::axCopyAttributeValueAsString): (WTR::axCopyAttributeValueAsElementArray): (WTR::AccessibilityUIElementClientMac::create): (WTR::AccessibilityUIElementClientMac::createForUIProcess): (WTR::AccessibilityUIElementClientMac::AccessibilityUIElementClientMac): (WTR::AccessibilityUIElementClientMac::~AccessibilityUIElementClientMac): (WTR::AccessibilityUIElementClientMac::platformUIElement): (WTR::AccessibilityUIElementClientMac::isValid const): (WTR::AccessibilityUIElementClientMac::role): (WTR::AccessibilityUIElementClientMac::title): (WTR::AccessibilityUIElementClientMac::description): (WTR::AccessibilityUIElementClientMac::stringValue): (WTR::AccessibilityUIElementClientMac::getChildren const): (WTR::AccessibilityUIElementClientMac::getChildrenInRange const): (WTR::AccessibilityUIElementClientMac::childrenCount): (WTR::AccessibilityUIElementClientMac::childAtIndex): * Tools/WebKitTestRunner/TestController.cpp: * Tools/WebKitTestRunner/TestController.h: * Tools/WebKitTestRunner/TestInvocation.cpp: (WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle): * Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj: * Tools/WebKitTestRunner/mac/TestControllerMac.mm: (WTR::TestController::getRemoteAccessibilityToken): (WTR::TestController::initializeWebProcessAccessibility):
0bd9215 to
02562b9
Compare
Collaborator
|
EWS run on current version of this PR (hash 02562b9) Details |
Contributor
Author
|
Moved to: #57568 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🛠 mac-AS-debug
02562b9
02562b9
🛠 mac🛠 win🧪 wpe-wk2🧪 win-tests🧪 api-mac🧪 api-wpe🧪 api-mac-debug🧪 mac-wk1🧪 mac-wk2🧪 gtk-wk2🛠 vision-sim🧪 mac-AS-debug-wk2🧪 api-gtk🧪 mac-wk2-stress🛠 playstation🧪 mac-intel-wk2🛠 tv-sim🛠 mac-safer-cpp🛠 watch🛠 watch-sim