Bug 233085 - AX: Make 7 more layout tests async so that they pass in --release --accessibility-isolated-tree mode
Summary: AX: Make 7 more layout tests async so that they pass in --release --accessibi...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tyler Wilcock
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-11-13 09:13 PST by Tyler Wilcock
Modified: 2021-11-15 20:48 PST (History)
10 users (show)

See Also:


Attachments
Patch (31.70 KB, patch)
2021-11-13 09:18 PST, Tyler Wilcock
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tyler Wilcock 2021-11-13 09:13:29 PST
Make 7 more layout tests async so that they pass in --release --accessibility-isolated-tree mode
Comment 1 Radar WebKit Bug Importer 2021-11-13 09:13:42 PST
<rdar://problem/85376470>
Comment 2 Tyler Wilcock 2021-11-13 09:18:55 PST
Created attachment 444139 [details]
Patch
Comment 3 EWS 2021-11-13 13:57:39 PST
Committed r285778 (244222@main): <https://commits.webkit.org/244222@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 444139 [details].
Comment 4 Andres Gonzalez 2021-11-15 09:12:27 PST
(In reply to Tyler Wilcock from comment #2)
> Created attachment 444139 [details]
> Patch

--- a/LayoutTests/accessibility/ancestor-computation.html
+++ a/LayoutTests/accessibility/ancestor-computation.html

+        let elementsToCheck = [await waitForElementById(startElementId)];

Why is this an array? 

--- a/LayoutTests/accessibility/color-well.html
+++ a/LayoutTests/accessibility/color-well.html

+            let axColorwell = await waitForElementById("empty_colorwell");

Do we really need to wait to get the accessible element for these elements? I would think we can get them without having to wait, i.e., just with AccessibilityController.accessibleElementById.

In general, we should need to wait only if a mutation on the tree occurs, or if any property of elements change. In case of static docs where the JS is doing just reading of properties, we shouldn't need to wait.

--- a/LayoutTests/resources/accessibility-helper.js
+++ a/LayoutTests/resources/accessibility-helper.js

+async function waitForExpression(element, expression, expectedValue) {

Most (or all) calls to this function are followed by a shouldBE. Can we put the shouldBe as part of this function? As you did in one of the tests, with a more explicit name.
Comment 5 Tyler Wilcock 2021-11-15 20:48:30 PST
(In reply to Andres Gonzalez from comment #4)
> (In reply to Tyler Wilcock from comment #2)
> > Created attachment 444139 [details]
> > Patch
> 
> --- a/LayoutTests/accessibility/ancestor-computation.html
> +++ a/LayoutTests/accessibility/ancestor-computation.html
> 
> +        let elementsToCheck = [await waitForElementById(startElementId)];
> 
> Why is this an array? 
> 
> --- a/LayoutTests/accessibility/color-well.html
> +++ a/LayoutTests/accessibility/color-well.html
> 
> +            let axColorwell = await waitForElementById("empty_colorwell");
> 
> Do we really need to wait to get the accessible element for these elements?
> I would think we can get them without having to wait, i.e., just with
> AccessibilityController.accessibleElementById.
> 
> In general, we should need to wait only if a mutation on the tree occurs, or
> if any property of elements change. In case of static docs where the JS is
> doing just reading of properties, we shouldn't need to wait.
> 
> --- a/LayoutTests/resources/accessibility-helper.js
> +++ a/LayoutTests/resources/accessibility-helper.js
> 
> +async function waitForExpression(element, expression, expectedValue) {
> 
> Most (or all) calls to this function are followed by a shouldBE. Can we put
> the shouldBe as part of this function? As you did in one of the tests, with
> a more explicit name.
All good points. Addressing in: https://bugs.webkit.org/show_bug.cgi?id=233167