Changeset 285874 in webkit
- Timestamp:
- Nov 16, 2021, 11:26:36 AM (5 years ago)
- Location:
- trunk/LayoutTests
- Files:
-
- 14 edited
-
ChangeLog (modified) (1 diff)
-
accessibility/color-well.html (modified) (1 diff)
-
accessibility/mac/header-expected.txt (modified) (1 diff)
-
accessibility/mac/header.html (modified) (1 diff)
-
accessibility/mac/scrollbars.html (modified) (1 diff)
-
accessibility/placeholder.html (modified) (1 diff)
-
accessibility/progressbar.html (modified) (1 diff)
-
accessibility/range-alter-by-percent-expected.txt (modified) (1 diff)
-
accessibility/range-alter-by-percent.html (modified) (1 diff)
-
accessibility/range-alter-by-step-expected.txt (modified) (1 diff)
-
accessibility/range-alter-by-step.html (modified) (2 diffs)
-
accessibility/spinbutton-value-expected.txt (modified) (1 diff)
-
accessibility/spinbutton-value.html (modified) (1 diff)
-
resources/accessibility-helper.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r285857 r285874 1 2021-11-16 Tyler Wilcock <tyler_w@apple.com> 2 3 AX: Simplify tests changed in https://bugs.webkit.org/show_bug.cgi?id=233085 4 https://bugs.webkit.org/show_bug.cgi?id=233167 5 6 Reviewed by Andres Gonzalez. 7 8 In https://bugs.webkit.org/show_bug.cgi?id=233085 and https://bugs.webkit.org/show_bug.cgi?id=233017, 9 we made some tests async so that they passed in --release --accessibility-isolated-tree mode. However, 10 we can make these tests simpler and still pass — i.e., only wait for elements and expressions asynchronously 11 when it's absolutely necessary. 12 13 * accessibility/color-well.html: 14 * accessibility/mac/header-expected.txt: 15 * accessibility/mac/header.html: 16 * accessibility/mac/scrollbars.html: 17 * accessibility/placeholder.html: 18 * accessibility/progressbar.html: 19 * accessibility/range-alter-by-percent-expected.txt: 20 * accessibility/range-alter-by-percent.html: 21 * accessibility/range-alter-by-step-expected.txt: 22 * accessibility/range-alter-by-step.html: 23 * accessibility/spinbutton-value-expected.txt: 24 * accessibility/spinbutton-value.html: 25 Simplify these tests by only use async waiting when 26 necessary (i.e. dynamic mutation via JS) 27 28 * resources/accessibility-helper.js: 29 (async expectAsyncExpression): 30 (async waitForExpression): Renamed to expectAsyncExpression. 31 1 32 2021-11-16 Commit Queue <commit-queue@webkit.org> 2 33 -
trunk/LayoutTests/accessibility/color-well.html
r285778 r285874 15 15 16 16 if (window.accessibilityController) { 17 window.jsTestIsAsync = true; 17 let axColorwell = accessibilityController.accessibleElementById("empty_colorwell"); 18 debug("Role of input type=color is: " + axColorwell.role); 19 debug("Value of empty color well: " + axColorwell.stringValue); 18 20 19 setTimeout(async function() { 20 let axColorwell = await waitForElementById("empty_colorwell"); 21 debug("Role of input type=color is: " + axColorwell.role); 22 debug("Value of empty color well: " + axColorwell.stringValue); 21 axColorwell = accessibilityController.accessibleElementById("good_colorwell"); 22 debug("Value of good color well: " + axColorwell.stringValue); 23 23 24 axColorwell = await waitForElementById("good_colorwell"); 25 debug("Value of good color well: " + axColorwell.stringValue); 26 27 axColorwell = await waitForElementById("bad_colorwell"); 28 debug("Value of bad color well: " + axColorwell.stringValue); 29 30 finishJSTest(); 31 }, 0); 24 axColorwell = accessibilityController.accessibleElementById("bad_colorwell"); 25 debug("Value of bad color well: " + axColorwell.stringValue); 32 26 } 33 27 </script> -
trunk/LayoutTests/accessibility/mac/header-expected.txt
r285776 r285874 1 PASS accessibilityController. focusedElement.role is "AXRole: AXGroup"2 PASS accessibilityController. focusedElement.roleDescription is "AXRoleDescription: banner"3 PASS accessibilityController. focusedElement.role is "AXRole: AXGroup"4 PASS accessibilityController. focusedElement.roleDescription is "AXRoleDescription: group"5 PASS accessibilityController. focusedElement.role is "AXRole: AXGroup"6 PASS accessibilityController. focusedElement.roleDescription is "AXRoleDescription: group"1 PASS accessibilityController.accessibleElementById("header01").role is "AXRole: AXGroup" 2 PASS accessibilityController.accessibleElementById("header01").roleDescription is "AXRoleDescription: banner" 3 PASS accessibilityController.accessibleElementById("header02").role is "AXRole: AXGroup" 4 PASS accessibilityController.accessibleElementById("header02").roleDescription is "AXRoleDescription: group" 5 PASS accessibilityController.accessibleElementById("header03").role is "AXRole: AXGroup" 6 PASS accessibilityController.accessibleElementById("header03").roleDescription is "AXRoleDescription: group" 7 7 PASS successfullyParsed is true 8 8 -
trunk/LayoutTests/accessibility/mac/header.html
r285776 r285874 16 16 17 17 <script> 18 async function expectRole(expectedRole, expectedDescription, id) { 19 document.getElementById(id).focus(); 20 21 await waitFor(() => { 22 const focusedElement = accessibilityController.focusedElement; 23 return focusedElement && focusedElement.domIdentifier === id; 24 }); 25 26 shouldBeEqualToString("accessibilityController.focusedElement.role", "AXRole: " + expectedRole); 27 shouldBeEqualToString("accessibilityController.focusedElement.roleDescription", "AXRoleDescription: " + expectedDescription); 18 function expectRole(expectedRole, expectedDescription, id) { 19 shouldBeEqualToString(`accessibilityController.accessibleElementById("${id}").role`, `AXRole: ${expectedRole}`); 20 shouldBeEqualToString(`accessibilityController.accessibleElementById("${id}").roleDescription`, `AXRoleDescription: ${expectedDescription}`); 28 21 } 29 22 30 23 if (window.accessibilityController) { 31 window.jsTestIsAsync = true; 32 33 setTimeout(async function() { 34 await expectRole("AXGroup", "banner", "header01"); 35 await expectRole("AXGroup", "group", "header02"); 36 await expectRole("AXGroup", "group", "header03"); 37 38 finishJSTest(); 39 }, 0); 24 expectRole("AXGroup", "banner", "header01"); 25 expectRole("AXGroup", "group", "header02"); 26 expectRole("AXGroup", "group", "header03"); 40 27 } 41 28 </script> -
trunk/LayoutTests/accessibility/mac/scrollbars.html
r285778 r285874 21 21 setTimeout(async function() { 22 22 // Iterate up from the body AX element to the scrollarea AX element. 23 let maybeScrollArea = (await waitForElementById("body")).parentElement(); 23 let maybeScrollArea = scrollArea = accessibilityController.accessibleElementById("body"); 24 while (maybeScrollArea) { 25 if (maybeScrollArea.role === "AXRole: AXScrollArea") { 26 scrollArea = maybeScrollArea; 27 break; 28 } 29 maybeScrollArea = maybeScrollArea.parentElement(); 30 } 31 32 // Wait for scrollbar to be created. 24 33 await waitFor(() => { 25 if (maybeScrollArea && maybeScrollArea.role === "AXRole: AXScrollArea") { 26 scrollArea = maybeScrollArea; 27 return true; 28 } 29 30 maybeScrollArea = maybeScrollArea.parentElement(); 31 return false; 34 return scrollArea.verticalScrollbar; 32 35 }); 33 36 -
trunk/LayoutTests/accessibility/placeholder.html
r285778 r285874 19 19 description("This test makes sure that the placeholder is returned as the correct attribute"); 20 20 21 var fieldElement, passwordElement, searchElement, textInput;22 21 if (window.accessibilityController) { 23 window.jsTestIsAsync = true; 22 var fieldElement = accessibilityController.accessibleElementById("searchterm"); 23 shouldBe("fieldElement.stringAttributeValue('AXPlaceholderValue')", "'search'"); 24 24 25 setTimeout(async function() { 26 fieldElement = await waitForElementById("searchterm"); 27 shouldBe("fieldElement.stringAttributeValue('AXPlaceholderValue')", "'search'"); 25 var passwordElement = accessibilityController.accessibleElementById("password"); 26 shouldBe("passwordElement.stringAttributeValue('AXPlaceholderValue')", "'Password'"); 28 27 29 passwordElement = await waitForElementById("password"); 30 shouldBe("passwordElement.stringAttributeValue('AXPlaceholderValue')", "'Password'"); 31 32 searchElement = await waitForElementById("search"); 33 shouldBe("searchElement.stringAttributeValue('AXPlaceholderValue')", "'MM-DD-YYYY'"); 34 35 // When the placeholder and aria-placeholder attributes are both present, use the placeholder 36 // attribute's value. 37 textInput = await waitForElementById("input"); 38 shouldBe("textInput.stringAttributeValue('AXPlaceholderValue')", "'Fill in the blank'"); 28 var searchElement = accessibilityController.accessibleElementById("search"); 29 shouldBe("searchElement.stringAttributeValue('AXPlaceholderValue')", "'MM-DD-YYYY'"); 39 30 40 finishJSTest(); 41 }, 0); 31 // When the placeholder and aria-placeholder attributes are both present, use the placeholder attribute's value. 32 var textInput = accessibilityController.accessibleElementById("input"); 33 shouldBe("textInput.stringAttributeValue('AXPlaceholderValue')", "'Fill in the blank'"); 42 34 } 43 35 </script> -
trunk/LayoutTests/accessibility/progressbar.html
r285778 r285874 18 18 var progressbar1, progressbar2, progressbar3, progressbar4; 19 19 if (window.accessibilityController) { 20 window.jsTestIsAsync = true; 20 // ARIA determinate progressbar 21 progressbar1 = accessibilityController.accessibleElementById("progressbar1"); 22 shouldBe("progressbar1.intValue", "7"); 21 23 22 setTimeout(async function() { 23 // ARIA determinate progressbar 24 progressbar1 = await waitForElementById("progressbar1"); 25 await waitForExpression(progressbar1, "intValue", 7); 26 shouldBe("progressbar1.intValue", "7"); 24 // ARIA indeterminate progressbar 25 progressbar2 = accessibilityController.accessibleElementById("progressbar2"); 26 shouldBe("progressbar2.intValue", "5"); 27 27 28 // ARIA indeterminate progressbar29 progressbar2 = await waitForElementById("progressbar2");30 await waitForExpression(progressbar2, "intValue", 5);31 shouldBe("progressbar2.intValue", "5");28 // Determinate progress element 29 progressbar3 = accessibilityController.accessibleElementById("progressbar3"); 30 shouldBe("progressbar3.intValue", "7"); 31 shouldBe("progressbar3.role", "'AXRole: AXProgressIndicator'"); 32 32 33 // Determinate progress element 34 progressbar3 = await waitForElementById("progressbar3"); 35 await waitForExpression(progressbar3, "intValue", 7); 36 shouldBe("progressbar3.intValue", "7"); 37 shouldBe("progressbar3.role", "'AXRole: AXProgressIndicator'"); 38 39 // Indeterminate progress element 40 progressbar4 = await waitForElementById("progressbar4"); 41 await waitForExpression(progressbar4, "intValue", 0); 42 shouldBe("progressbar4.intValue", "0"); 43 shouldBe("progressbar4.role", "'AXRole: AXProgressIndicator'"); 44 45 finishJSTest(); 46 }, 0); 33 // Indeterminate progress element 34 progressbar4 = accessibilityController.accessibleElementById("progressbar4"); 35 shouldBe("progressbar4.intValue", "0"); 36 shouldBe("progressbar4.role", "'AXRole: AXProgressIndicator'"); 47 37 } 48 38 </script> -
trunk/LayoutTests/accessibility/range-alter-by-percent-expected.txt
r285778 r285874 5 5 6 6 PASS largeRange.intValue is 50 7 PASS largeRange.intValue is558 PASS largeRange.intValue is609 PASS largeRange.intValue is5510 PASS largeRange.intValue is507 PASS largeRange.intValue === 55 8 PASS largeRange.intValue === 60 9 PASS largeRange.intValue === 55 10 PASS largeRange.intValue === 50 11 11 PASS smallRange.intValue is 5 12 PASS smallRange.intValue is613 PASS smallRange.intValue is714 PASS smallRange.intValue is615 PASS smallRange.intValue is512 PASS smallRange.intValue === 6 13 PASS smallRange.intValue === 7 14 PASS smallRange.intValue === 6 15 PASS smallRange.intValue === 5 16 16 PASS successfullyParsed is true 17 17 -
trunk/LayoutTests/accessibility/range-alter-by-percent.html
r285778 r285874 24 24 25 25 setTimeout(async function() { 26 largeRange = await waitForElementById("largeRange"); 27 await waitForExpression(largeRange, "intValue", 50); 28 shouldBe("largeRange.intValue", "50"); 29 largeRange.increment(); 30 await waitForExpression(largeRange, "intValue", 55); 31 shouldBe("largeRange.intValue", "55"); 32 largeRange.increment(); 33 await waitForExpression(largeRange, "intValue", 60); 34 shouldBe("largeRange.intValue", "60"); 35 largeRange.decrement(); 36 await waitForExpression(largeRange, "intValue", 55); 37 shouldBe("largeRange.intValue", "55"); 38 largeRange.decrement(); 39 await waitForExpression(largeRange, "intValue", 50); 26 largeRange = accessibilityController.accessibleElementById("largeRange"); 40 27 shouldBe("largeRange.intValue", "50"); 41 28 42 smallRange = await waitForElementById("smallRange"); 43 await waitForExpression(smallRange, "intValue", 5); 29 largeRange.increment(); 30 await expectAsyncExpression("largeRange.intValue", 55); 31 32 largeRange.increment(); 33 await expectAsyncExpression("largeRange.intValue", 60); 34 35 largeRange.decrement(); 36 await expectAsyncExpression("largeRange.intValue", 55); 37 38 largeRange.decrement(); 39 await expectAsyncExpression("largeRange.intValue", 50); 40 41 smallRange = accessibilityController.accessibleElementById("smallRange"); 44 42 shouldBe("smallRange.intValue", "5"); 43 45 44 smallRange.increment(); 46 await waitForExpression(smallRange, "intValue", 6);47 shouldBe("smallRange.intValue", "6"); 45 await expectAsyncExpression("smallRange.intValue", 6); 46 48 47 smallRange.increment(); 49 await waitForExpression(smallRange, "intValue", 7);50 shouldBe("smallRange.intValue", "7"); 48 await expectAsyncExpression("smallRange.intValue", 7); 49 51 50 smallRange.decrement(); 52 await waitForExpression(smallRange, "intValue", 6);53 shouldBe("smallRange.intValue", "6"); 51 await expectAsyncExpression("smallRange.intValue", 6); 52 54 53 smallRange.decrement(); 55 await waitForExpression(smallRange, "intValue", 5); 56 shouldBe("smallRange.intValue", "5"); 54 await expectAsyncExpression("smallRange.intValue", 5); 57 55 58 56 finishJSTest(); -
trunk/LayoutTests/accessibility/range-alter-by-step-expected.txt
r285778 r285874 5 5 6 6 PASS rangeInput.intValue is 25 7 PASS rangeInput.intValue is508 PASS rangeInput.intValue is759 PASS rangeInput.intValue is10010 PASS rangeInput.intValue is10011 PASS rangeInput.intValue is7512 PASS rangeInput.intValue is5013 PASS rangeInput.intValue is2514 PASS rangeInput.intValue is015 PASS rangeInput.intValue is07 PASS rangeInput.intValue === 50 8 PASS rangeInput.intValue === 75 9 PASS rangeInput.intValue === 100 10 PASS rangeInput.intValue === 100 11 PASS rangeInput.intValue === 75 12 PASS rangeInput.intValue === 50 13 PASS rangeInput.intValue === 25 14 PASS rangeInput.intValue === 0 15 PASS rangeInput.intValue === 0 16 16 PASS successfullyParsed is true 17 17 -
trunk/LayoutTests/accessibility/range-alter-by-step.html
r285778 r285874 13 13 14 14 var rangeInput; 15 async function waitForAndExpectIntValue(expectedIntValue) {16 await waitForExpression(rangeInput, "intValue", expectedIntValue);17 shouldBe("rangeInput.intValue", `${expectedIntValue}`)18 }19 20 15 if (window.accessibilityController) { 21 16 window.jsTestIsAsync = true; … … 24 19 // ARIA determinate progressbar 25 20 rangeInput = await waitForElementById("rangeInput"); 26 await waitForAndExpectIntValue(25);21 shouldBe("rangeInput.intValue", "25"); 27 22 28 23 rangeInput.increment(); 29 await waitForAndExpectIntValue(50);24 await expectAsyncExpression("rangeInput.intValue", 50); 30 25 31 26 rangeInput.increment(); 32 await waitForAndExpectIntValue(75);27 await expectAsyncExpression("rangeInput.intValue", 75); 33 28 34 29 rangeInput.increment(); 35 await waitForAndExpectIntValue(100);30 await expectAsyncExpression("rangeInput.intValue", 100); 36 31 37 32 rangeInput.increment(); 38 await waitForAndExpectIntValue(100);33 await expectAsyncExpression("rangeInput.intValue", 100); 39 34 40 35 rangeInput.decrement(); 41 await waitForAndExpectIntValue(75);36 await expectAsyncExpression("rangeInput.intValue", 75); 42 37 43 38 rangeInput.decrement(); 44 await waitForAndExpectIntValue(50);39 await expectAsyncExpression("rangeInput.intValue", 50); 45 40 46 41 rangeInput.decrement(); 47 await waitForAndExpectIntValue(25);42 await expectAsyncExpression("rangeInput.intValue", 25); 48 43 49 44 rangeInput.decrement(); 50 await waitForAndExpectIntValue(0);45 await expectAsyncExpression("rangeInput.intValue", 0); 51 46 52 47 rangeInput.decrement(); 53 await waitForAndExpectIntValue(0);48 await expectAsyncExpression("rangeInput.intValue", 0); 54 49 55 50 finishJSTest(); -
trunk/LayoutTests/accessibility/spinbutton-value-expected.txt
r285778 r285874 4 4 5 5 6 PASS spinbutton.intValue is 5 6 7 PASS endsWith(spinbutton.intValue, '5') is true 7 8 PASS endsWith(spinbutton.minValue, '1') is true -
trunk/LayoutTests/accessibility/spinbutton-value.html
r285778 r285874 27 27 var spinbutton, untitledButton; 28 28 if (window.accessibilityController) { 29 window.jsTestIsAsync = true; 29 untitledButton = accessibilityController.accessibleElementById("untitledButton"); 30 spinbutton = accessibilityController.accessibleElementById("spinbutton"); 31 shouldBe("spinbutton.intValue", "5"); 30 32 31 setTimeout(async function() { 32 untitledButton = await waitForElementById("untitledButton"); 33 spinbutton = await waitForElementById("spinbutton"); 34 await waitForExpression(spinbutton, "intValue", 5); 33 // Test range value attributes. 34 shouldBe("endsWith(spinbutton.intValue, '5')", "true"); 35 shouldBe("endsWith(spinbutton.minValue, '1')", "true"); 36 shouldBe("endsWith(spinbutton.maxValue, '9')", "true"); 37 shouldBe("endsWith(spinbutton.valueDescription, '5 of 9')", "true"); 35 38 36 // Test range value attributes. 37 shouldBe("endsWith(spinbutton.intValue, '5')", "true"); 38 shouldBe("endsWith(spinbutton.minValue, '1')", "true"); 39 shouldBe("endsWith(spinbutton.maxValue, '9')", "true"); 40 shouldBe("endsWith(spinbutton.valueDescription, '5 of 9')", "true"); 41 42 // Make sure the title doesn't come from the inner text. It should just be empty if 43 // not otherwise specified. 44 shouldBe("spinbutton.title", "untitledButton.title"); 45 46 finishJSTest(); 47 }, 0); 39 // Make sure the title doesn't come from the inner text. It should just be empty if 40 // not otherwise specified. 41 shouldBe("spinbutton.title", "untitledButton.title"); 48 42 } 49 43 </script> -
trunk/LayoutTests/resources/accessibility-helper.js
r285778 r285874 121 121 } 122 122 123 async function waitForExpression(element,expression, expectedValue) {123 async function expectAsyncExpression(expression, expectedValue) { 124 124 if (typeof expression !== "string") 125 125 debug("WARN: The expression arg in waitForExpression() should be a string."); 126 126 127 const evalExpression = `${expression} === ${expectedValue}`; 127 128 await waitFor(() => { 128 return eval( `element.${expression} === ${expectedValue}`);129 return eval(evalExpression); 129 130 }); 131 debug(`PASS ${evalExpression}`); 130 132 } 131 133
Note:
See TracChangeset
for help on using the changeset viewer.