NEW 89103
Should be easier to write cross-platform accessibility layout tests
https://bugs.webkit.org/show_bug.cgi?id=89103
Summary Should be easier to write cross-platform accessibility layout tests
Dominic Mazzoni
Reported 2012-06-14 08:02:31 PDT
Right now any layout test of the role of an element must be customized for each platform. If the author of the test doesn't have the ability to generate different expectations and verify they're correct, many tests end up being written that only work on one platform. Ideas: * Add an accessor to accessibilityUIElement for a cross-platform role string. * Add a method to search the tree for the first instance of a cross-platform role
Attachments
Mike West
Comment 1 2012-06-14 08:06:16 PDT
See https://bugs.webkit.org/show_bug.cgi?id=88911 as an example of such a test that ends up being mac only, though there's nothing really mac-specific about it.
Mike West
Comment 2 2012-06-14 08:08:27 PDT
Moving Dominic's comments from that bug here: > > BTW, I would really like to see a way to write "cross-platform" accessibility tests that test for the WebCore role rather than the platform-specific role, I just haven't had a chance to think about how to do that refactoring yet. > > I've only taken a very quick look at the code, but it seems like it should be possible to set up a mechanism to test the "real" role in DumpRenderTree by adding some methods to AccessibilityUIElement. Maybe with an enum hanging around that's mapped onto ARIARoleMap? > > Seomthing like AccessibilityUIElement::isRole([enum]) and AccessibilityUIElement::isRoleDescription([enum])? > > Is there a bug for this sort of refactoring? It sounds like it'd be useful... Added a new bug: https://bugs.webkit.org/show_bug.cgi?id=89103 isRole wouldn't work very well, we'd have to expose the enum to JavaScript. Instead we should just expose the WebCore role name as a string in JavaScript, and make it a compile error to add a new role without adding the role name. I don't think we need to have role descriptions in cross-platform tests, that's a Mac-only concept. The WebCore role enum should encompass all distinct roles, and each platform should map a role to whatever makes sense on that platform - on Mac one role might map to a {role, roleDescription} tuple.
chris fleizach
Comment 3 2012-06-14 11:46:24 PDT
(In reply to comment #2) > Moving Dominic's comments from that bug here: > > > > BTW, I would really like to see a way to write "cross-platform" accessibility tests that test for the WebCore role rather than the platform-specific role, I just haven't had a chance to think about how to do that refactoring yet. > > > > I've only taken a very quick look at the code, but it seems like it should be possible to set up a mechanism to test the "real" role in DumpRenderTree by adding some methods to AccessibilityUIElement. Maybe with an enum hanging around that's mapped onto ARIARoleMap? > > > > Seomthing like AccessibilityUIElement::isRole([enum]) and AccessibilityUIElement::isRoleDescription([enum])? > > > > Is there a bug for this sort of refactoring? It sounds like it'd be useful... > > Added a new bug: > https://bugs.webkit.org/show_bug.cgi?id=89103 > > isRole wouldn't work very well, we'd have to expose the enum to JavaScript. Instead we should just expose the WebCore role name as a string in JavaScript, and make it a compile error to add a new role without adding the role name. > > I don't think we need to have role descriptions in cross-platform tests, that's a Mac-only concept. The WebCore role enum should encompass all distinct roles, and each platform should map a role to whatever makes sense on that platform - on Mac one role might map to a {role, roleDescription} tuple. I think we should have DRT specific method that can get the roleValue() from AccessibilityObject and then convert that into a neutral string that we can test against in the layout tests
Radar WebKit Bug Importer
Comment 4 2013-12-20 11:57:34 PST
Note You need to log in before you can comment on or make changes to this bug.