Changeset 285778 in webkit
- Timestamp:
- Nov 13, 2021, 1:57:32 PM (5 years ago)
- Location:
- trunk/LayoutTests
- Files:
-
- 16 edited
-
ChangeLog (modified) (1 diff)
-
accessibility/ancestor-computation.html (modified) (1 diff)
-
accessibility/color-well-expected.txt (modified) (1 diff)
-
accessibility/color-well.html (modified) (1 diff)
-
accessibility/mac/scrollbars.html (modified) (2 diffs)
-
accessibility/placeholder-expected.txt (modified) (2 diffs)
-
accessibility/placeholder.html (modified) (1 diff)
-
accessibility/progressbar-expected.txt (modified) (2 diffs)
-
accessibility/progressbar.html (modified) (2 diffs)
-
accessibility/range-alter-by-percent-expected.txt (modified) (1 diff)
-
accessibility/range-alter-by-percent.html (modified) (2 diffs)
-
accessibility/range-alter-by-step-expected.txt (modified) (2 diffs)
-
accessibility/range-alter-by-step.html (modified) (1 diff)
-
accessibility/spinbutton-value-expected.txt (modified) (2 diffs)
-
accessibility/spinbutton-value.html (modified) (2 diffs)
-
resources/accessibility-helper.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r285776 r285778 1 2021-11-13 Tyler Wilcock <tyler_w@apple.com> 2 3 AX: Make 7 more layout tests async so that they pass in --release --accessibility-isolated-tree mode 4 https://bugs.webkit.org/show_bug.cgi?id=233085 5 6 Reviewed by Chris Fleizach. 7 8 This patch makes 7 more tests async so that they pass in --release 9 --accessibility-isolated-tree mode. This patch also adds some helper 10 functions to accessibility-helper.js. 11 12 * accessibility/ancestor-computation.html: 13 Move `waitForElement` to accessibility-helpers.js and rename to 14 `waitForElementById`. 15 16 * accessibility/color-well-expected.txt: 17 * accessibility/color-well.html: 18 * accessibility/mac/scrollbars.html: 19 * accessibility/placeholder-expected.txt: 20 * accessibility/placeholder.html: 21 * accessibility/progressbar-expected.txt: 22 * accessibility/progressbar.html: 23 * accessibility/range-alter-by-percent-expected.txt: 24 * accessibility/range-alter-by-percent.html: 25 * accessibility/range-alter-by-step-expected.txt: 26 * accessibility/range-alter-by-step.html: 27 * accessibility/spinbutton-value-expected.txt: 28 * accessibility/spinbutton-value.html: 29 Make tests async so they pass in isolated tree mode. 30 Minor updates to expectations: 31 - Some variables renamed for better readability 32 - Sometimes there is one more or one less newline after the test rewrites 33 34 * resources/accessibility-helper.js: 35 (async waitForElementById): Added. Originally defined in 36 accessibility/ancestor-computation.html. 37 (async waitForExpression): Added. 38 1 39 2021-11-13 Tyler Wilcock <tyler_w@apple.com> 2 40 -
trunk/LayoutTests/accessibility/ancestor-computation.html
r285589 r285778 54 54 var element; 55 55 56 async function waitForElement(id) {57 let returnElement;58 await waitFor(() => {59 returnElement = accessibilityController.accessibleElementById(id);60 return returnElement;61 });62 return returnElement;63 }64 65 56 async function shouldBeForAllDescendants(startElementId, expectedPropertyValues) { 66 57 debug(`Verifying ${JSON.stringify(expectedPropertyValues)} for all descendants of ${startElementId}.`); 67 58 68 let elementsToCheck = [await waitForElement (startElementId)];59 let elementsToCheck = [await waitForElementById(startElementId)]; 69 60 while (elementsToCheck.length) { 70 61 element = elementsToCheck.pop(); -
trunk/LayoutTests/accessibility/color-well-expected.txt
r267644 r285778 1 2 1 This test checks the role of ColorWellRolean input with type=color 3 2 -
trunk/LayoutTests/accessibility/color-well.html
r155274 r285778 1 < html>1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> 2 2 <html> 3 3 <head> 4 <script src="../resources/js-test-pre.js"></script> 4 <script src="../resources/js-test.js"></script> 5 <script src="../resources/accessibility-helper.js"></script> 5 6 </head> 6 <body id="body">7 <body> 7 8 8 <input id="empty_colorwell" type="color">9 <input id="good_colorwell" type="color" value="#ff0000">10 <input id="bad_colorwell" type="color" value="purple">9 <input id="empty_colorwell" type="color"> 10 <input id="good_colorwell" type="color" value="#ff0000"> 11 <input id="bad_colorwell" type="color" value="purple"> 11 12 12 <p id="description"></p> 13 <div id="console"></div> 14 15 <script> 16 if (window.accessibilityController) { 17 description("This test checks the role of ColorWellRolean input with type=color"); 13 <script> 14 description("This test checks the role of ColorWellRolean input with type=color"); 18 15 19 var colorwell = document.getElementById("empty_colorwell").focus(); 20 var axColorwell = accessibilityController.focusedElement; 16 if (window.accessibilityController) { 17 window.jsTestIsAsync = true; 18 19 setTimeout(async function() { 20 let axColorwell = await waitForElementById("empty_colorwell"); 21 21 debug("Role of input type=color is: " + axColorwell.role); 22 23 22 debug("Value of empty color well: " + axColorwell.stringValue); 24 23 25 colorwell = document.getElementById("good_colorwell").focus(); 26 axColorwell = accessibilityController.focusedElement; 24 axColorwell = await waitForElementById("good_colorwell"); 27 25 debug("Value of good color well: " + axColorwell.stringValue); 28 26 29 colorwell = document.getElementById("bad_colorwell").focus(); 30 axColorwell = accessibilityController.focusedElement; 27 axColorwell = await waitForElementById("bad_colorwell"); 31 28 debug("Value of bad color well: " + axColorwell.stringValue); 32 }33 </script>34 29 35 <script src="../resources/js-test-post.js"></script> 30 finishJSTest(); 31 }, 0); 32 } 33 </script> 34 </body> 35 </html> 36 36 37 </body>38 </html> -
trunk/LayoutTests/accessibility/mac/scrollbars.html
r187799 r285778 2 2 <html> 3 3 <head> 4 <script> 5 var successfullyParsed = false; 6 </script> 7 <script src="../../resources/js-test-pre.js"></script> 4 <script src="../../resources/js-test.js"></script> 5 <script src="../../resources/accessibility-helper.js"></script> 8 6 </head> 9 <body id="body" tabindex="0"> 10 11 <p id="description"></p> 12 <div id="console"></div> 13 14 <div role="textbox" id="iframeGroup"></div> 7 <body id="body" role="group"> 15 8 16 9 <script> 17 18 10 description("This tests that a scroll area will return scroll bars when asked."); 19 20 if (window.accessibilityController) {21 document.getElementById("body").focus();22 var body = accessibilityController.focusedElement;23 }24 11 25 12 // Cause the web page to gain scrollbars. … … 28 15 } 29 16 30 if (window.accessibilityController) {31 document.getElementById("body").focus();32 var body = accessibilityController.focusedElement;17 var scrollArea; 18 if (window.accessibilityController) { 19 window.jsTestIsAsync = true; 33 20 34 var scrollArea = body.parentElement(); 35 shouldBe("scrollArea.role", "'AXRole: AXScrollArea'"); 36 shouldBe("scrollArea.verticalScrollbar.role", "'AXRole: AXScrollBar'"); 21 setTimeout(async function() { 22 // Iterate up from the body AX element to the scrollarea AX element. 23 let maybeScrollArea = (await waitForElementById("body")).parentElement(); 24 await waitFor(() => { 25 if (maybeScrollArea && maybeScrollArea.role === "AXRole: AXScrollArea") { 26 scrollArea = maybeScrollArea; 27 return true; 28 } 29 30 maybeScrollArea = maybeScrollArea.parentElement(); 31 return false; 32 }); 33 34 shouldBe("scrollArea.role", "'AXRole: AXScrollArea'"); 35 shouldBe("scrollArea.verticalScrollbar.role", "'AXRole: AXScrollBar'"); 36 37 finishJSTest(); 38 }, 0); 37 39 } 38 39 successfullyParsed = true;40 40 </script> 41 42 <script src="../../resources/js-test-post.js"></script>43 41 </body> 44 42 </html> 43 -
trunk/LayoutTests/accessibility/placeholder-expected.txt
r207014 r285778 1 Birthday:2 03-14-18793 4 1 This test makes sure that the placeholder is returned as the correct attribute 5 2 … … 8 5 9 6 PASS fieldElement.stringAttributeValue('AXPlaceholderValue') is 'search' 10 PASS pass .stringAttributeValue('AXPlaceholderValue') is 'Password'11 PASS search .stringAttributeValue('AXPlaceholderValue') is 'MM-DD-YYYY'12 PASS input.stringAttributeValue('AXPlaceholderValue') is 'Fill in the blank'7 PASS passwordElement.stringAttributeValue('AXPlaceholderValue') is 'Password' 8 PASS searchElement.stringAttributeValue('AXPlaceholderValue') is 'MM-DD-YYYY' 9 PASS textInput.stringAttributeValue('AXPlaceholderValue') is 'Fill in the blank' 13 10 PASS successfullyParsed is true 14 11 15 12 TEST COMPLETE 13 Birthday: 14 03-14-1879 16 15 -
trunk/LayoutTests/accessibility/placeholder.html
r207014 r285778 1 < html>1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> 2 2 <html> 3 3 <head> 4 <script src="../resources/js-test-pre.js"></script> 4 <script src="../resources/js-test.js"></script> 5 <script src="../resources/accessibility-helper.js"></script> 5 6 </head> 6 <body id="body"> 7 8 <input placeholder="search" type="text" name="q" size="15" maxlength="255" id="searchterm" /> 7 <body> 9 8 10 <input id="password" class="field" type="password" name="sc1798" value="" placeholder="Password" spellcheck="true" maxlength="5096"> 9 <input placeholder="search" type="text" name="q" size="15" maxlength="255" id="searchterm" /> 10 11 <input id="password" class="field" type="password" name="sc1798" value="" placeholder="Password" spellcheck="true" maxlength="5096"> 12 13 <span id="label">Birthday:</span> 14 <div id="search" role="searchbox" aria-labelledby="label" aria-placeholder="MM-DD-YYYY">03-14-1879</div> 15 16 <input type="text" id="input" placeholder="Fill in the blank" aria-placeholder="aria placeholder"> 11 17 12 <span id="label">Birthday:</span> 13 <div id="search" role="searchbox" aria-labelledby="label" aria-placeholder="MM-DD-YYYY">03-14-1879</div> 14 15 <input type="text" id="input" placeholder="Fill in the blank" aria-placeholder="aria placeholder"> 16 17 <p id="description"></p> 18 <div id="console"></div> 19 20 <script> 21 if (window.accessibilityController) { 22 description("This test makes sure that the placeholder is returned as the correct attribute"); 18 <script> 19 description("This test makes sure that the placeholder is returned as the correct attribute"); 23 20 24 var field = document.getElementById("searchterm").focus(); 25 var fieldElement = accessibilityController.focusedElement; 21 var fieldElement, passwordElement, searchElement, textInput; 22 if (window.accessibilityController) { 23 window.jsTestIsAsync = true; 24 25 setTimeout(async function() { 26 fieldElement = await waitForElementById("searchterm"); 26 27 shouldBe("fieldElement.stringAttributeValue('AXPlaceholderValue')", "'search'"); 27 28 28 document.getElementById("password").focus(); 29 var pass = accessibilityController.focusedElement; 30 shouldBe("pass.stringAttributeValue('AXPlaceholderValue')", "'Password'"); 29 passwordElement = await waitForElementById("password"); 30 shouldBe("passwordElement.stringAttributeValue('AXPlaceholderValue')", "'Password'"); 31 31 32 var search = accessibilityController.accessibleElementById("search");33 shouldBe("search .stringAttributeValue('AXPlaceholderValue')", "'MM-DD-YYYY'");32 searchElement = await waitForElementById("search"); 33 shouldBe("searchElement.stringAttributeValue('AXPlaceholderValue')", "'MM-DD-YYYY'"); 34 34 35 35 // When the placeholder and aria-placeholder attributes are both present, use the placeholder 36 36 // attribute's value. 37 var input = accessibilityController.accessibleElementById("input"); 38 shouldBe("input.stringAttributeValue('AXPlaceholderValue')", "'Fill in the blank'"); 39 } 40 </script> 37 textInput = await waitForElementById("input"); 38 shouldBe("textInput.stringAttributeValue('AXPlaceholderValue')", "'Fill in the blank'"); 41 39 42 <script src="../resources/js-test-post.js"></script> 40 finishJSTest(); 41 }, 0); 42 } 43 </script> 43 44 </body> 44 45 </html> 46 -
trunk/LayoutTests/accessibility/progressbar-expected.txt
r267644 r285778 1 X X2 1 This test makes sure that progress element can be accessed by Accessibility FW. 3 2 … … 5 4 6 5 7 PASS obj.intValue is 78 PASS obj.intValue is 59 PASS obj.intValue is 710 PASS obj.role is 'AXRole: AXProgressIndicator'11 PASS obj.intValue is 012 PASS obj.role is 'AXRole: AXProgressIndicator'6 PASS progressbar1.intValue is 7 7 PASS progressbar2.intValue is 5 8 PASS progressbar3.intValue is 7 9 PASS progressbar3.role is 'AXRole: AXProgressIndicator' 10 PASS progressbar4.intValue is 0 11 PASS progressbar4.role is 'AXRole: AXProgressIndicator' 13 12 PASS successfullyParsed is true 14 13 15 14 TEST COMPLETE 16 15 X X -
trunk/LayoutTests/accessibility/progressbar.html
r208739 r285778 2 2 <html> 3 3 <head> 4 <script src="../resources/js-test-pre.js"></script> 4 <script src="../resources/js-test.js"></script> 5 <script src="../resources/accessibility-helper.js"></script> 5 6 </head> 6 <body id="body">7 <body> 7 8 8 9 <span tabindex="0" role="progressbar" id="progressbar1" aria-valuenow=7 aria-valuemin=0 aria-valuemax=10>X</span> … … 12 13 <progress tabindex="0" id="progressbar4"></progress> 13 14 14 <p id="description"></p>15 <div id="console"></div>16 17 15 <script> 18 19 16 description("This test makes sure that progress element can be accessed by Accessibility FW."); 20 17 18 var progressbar1, progressbar2, progressbar3, progressbar4; 21 19 if (window.accessibilityController) { 20 window.jsTestIsAsync = true; 22 21 23 // ARIA determinate progressbar 24 document.getElementById("progressbar1").focus(); 25 var obj = accessibilityController.focusedElement; 22 setTimeout(async function() { 23 // ARIA determinate progressbar 24 progressbar1 = await waitForElementById("progressbar1"); 25 await waitForExpression(progressbar1, "intValue", 7); 26 shouldBe("progressbar1.intValue", "7"); 26 27 27 shouldBe("obj.intValue", "7"); 28 // ARIA indeterminate progressbar 29 progressbar2 = await waitForElementById("progressbar2"); 30 await waitForExpression(progressbar2, "intValue", 5); 31 shouldBe("progressbar2.intValue", "5"); 28 32 29 // ARIA indeterminate progressbar 30 document.getElementById("progressbar2").focus(); 31 var obj = accessibilityController.focusedElement; 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'"); 32 38 33 shouldBe("obj.intValue", "5"); 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'"); 34 44 35 // determinate progress element 36 document.getElementById("progressbar3").focus(); 37 var obj = accessibilityController.focusedElement; 38 39 shouldBe("obj.intValue", "7"); 40 shouldBe("obj.role", "'AXRole: AXProgressIndicator'"); 41 42 // indeterminate progress element 43 document.getElementById("progressbar4").focus(); 44 var obj = accessibilityController.focusedElement; 45 46 shouldBe("obj.intValue", "0"); 47 shouldBe("obj.role", "'AXRole: AXProgressIndicator'"); 45 finishJSTest(); 46 }, 0); 48 47 } 49 50 48 </script> 51 52 <script src="../resources/js-test-post.js"></script>53 49 </body> 54 50 </html> 51 52 53 -
trunk/LayoutTests/accessibility/range-alter-by-percent-expected.txt
r267644 r285778 1 2 1 This tests that decrement and increment alter a range type input element by five percent or one (whichever is larger) when no step is specified. 3 2 -
trunk/LayoutTests/accessibility/range-alter-by-percent.html
r162587 r285778 1 <!DOCTYPE html> 1 2 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> 2 3 <html> 3 4 <head> 4 <script src="../resources/js-test-pre.js"></script> 5 <script src="../resources/js-test.js"></script> 6 <script src="../resources/accessibility-helper.js"></script> 5 7 <title>Range Alter by Percent</title> 6 8 </head> … … 14 16 <input id="smallRange" max="10" min="0" type="range" value="5"> 15 17 16 <p id="description"></p>17 <div id="console"></div>18 19 18 <script> 20 19 description("This tests that decrement and increment alter a range type input element by five percent or one (whichever is larger) when no step is specified."); 21 20 21 var smallRange, largeRange; 22 22 if (window.accessibilityController) { 23 // Large range. 24 var largeRange = accessibilityController.accessibleElementById("largeRange"); 25 shouldBe("largeRange.intValue", "50"); 26 largeRange.increment(); 27 shouldBe("largeRange.intValue", "55"); 28 largeRange.increment(); 29 shouldBe("largeRange.intValue", "60"); 30 largeRange.decrement(); 31 shouldBe("largeRange.intValue", "55"); 32 largeRange.decrement(); 33 shouldBe("largeRange.intValue", "50"); 34 35 // Small range. 36 var smallRange = accessibilityController.accessibleElementById("smallRange"); 37 shouldBe("smallRange.intValue", "5"); 38 smallRange.increment(); 39 shouldBe("smallRange.intValue", "6"); 40 smallRange.increment(); 41 shouldBe("smallRange.intValue", "7"); 42 smallRange.decrement(); 43 shouldBe("smallRange.intValue", "6"); 44 smallRange.decrement(); 45 shouldBe("smallRange.intValue", "5"); 23 window.jsTestIsAsync = true; 24 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); 40 shouldBe("largeRange.intValue", "50"); 41 42 smallRange = await waitForElementById("smallRange"); 43 await waitForExpression(smallRange, "intValue", 5); 44 shouldBe("smallRange.intValue", "5"); 45 smallRange.increment(); 46 await waitForExpression(smallRange, "intValue", 6); 47 shouldBe("smallRange.intValue", "6"); 48 smallRange.increment(); 49 await waitForExpression(smallRange, "intValue", 7); 50 shouldBe("smallRange.intValue", "7"); 51 smallRange.decrement(); 52 await waitForExpression(smallRange, "intValue", 6); 53 shouldBe("smallRange.intValue", "6"); 54 smallRange.decrement(); 55 await waitForExpression(smallRange, "intValue", 5); 56 shouldBe("smallRange.intValue", "5"); 57 58 finishJSTest(); 59 }, 0); 46 60 } 47 61 </script> 48 49 <script src="../resources/js-test-post.js"></script>50 62 </body> 51 63 </html> -
trunk/LayoutTests/accessibility/range-alter-by-step-expected.txt
r155444 r285778 1 2 1 This test makes sure that if a range type has a step value, that increment and decrement work. 3 2 … … 5 4 6 5 7 PASS obj.intValue is 258 PASS obj.intValue is 509 PASS obj.intValue is 7510 PASS obj.intValue is 10011 PASS obj.intValue is 10012 PASS obj.intValue is 7513 PASS obj.intValue is 5014 PASS obj.intValue is 2515 PASS obj.intValue is 016 PASS obj.intValue is 06 PASS rangeInput.intValue is 25 7 PASS rangeInput.intValue is 50 8 PASS rangeInput.intValue is 75 9 PASS rangeInput.intValue is 100 10 PASS rangeInput.intValue is 100 11 PASS rangeInput.intValue is 75 12 PASS rangeInput.intValue is 50 13 PASS rangeInput.intValue is 25 14 PASS rangeInput.intValue is 0 15 PASS rangeInput.intValue is 0 17 16 PASS successfullyParsed is true 18 17 -
trunk/LayoutTests/accessibility/range-alter-by-step.html
r155444 r285778 2 2 <html> 3 3 <head> 4 <script src="../resources/js-test-pre.js"></script> 4 <script src="../resources/js-test.js"></script> 5 <script src="../resources/accessibility-helper.js"></script> 5 6 </head> 6 <body id="body">7 <body> 7 8 8 <input type="range" min="0" max="100" value="25" step="25" id="range1"/> 9 10 <p id="description"></p> 11 <div id="console"></div> 9 <input type="range" min="0" max="100" value="25" step="25" id="rangeInput"/> 12 10 13 11 <script> 14 15 12 description("This test makes sure that if a range type has a step value, that increment and decrement work."); 16 13 17 if (window.accessibilityController) { 18 19 // ARIA determinate progressbar 20 document.getElementById("range1").focus(); 21 var obj = accessibilityController.focusedElement; 22 23 shouldBe("obj.intValue", "25"); 24 25 obj.increment(); 26 shouldBe("obj.intValue", "50"); 27 28 obj.increment(); 29 shouldBe("obj.intValue", "75"); 30 31 obj.increment(); 32 shouldBe("obj.intValue", "100"); 33 34 obj.increment(); 35 shouldBe("obj.intValue", "100"); 36 37 obj.decrement(); 38 shouldBe("obj.intValue", "75"); 39 40 obj.decrement(); 41 shouldBe("obj.intValue", "50"); 42 43 obj.decrement(); 44 shouldBe("obj.intValue", "25"); 45 46 obj.decrement(); 47 shouldBe("obj.intValue", "0"); 48 49 obj.decrement(); 50 shouldBe("obj.intValue", "0"); 14 var rangeInput; 15 async function waitForAndExpectIntValue(expectedIntValue) { 16 await waitForExpression(rangeInput, "intValue", expectedIntValue); 17 shouldBe("rangeInput.intValue", `${expectedIntValue}`) 51 18 } 52 19 20 if (window.accessibilityController) { 21 window.jsTestIsAsync = true; 22 23 setTimeout(async function() { 24 // ARIA determinate progressbar 25 rangeInput = await waitForElementById("rangeInput"); 26 await waitForAndExpectIntValue(25); 27 28 rangeInput.increment(); 29 await waitForAndExpectIntValue(50); 30 31 rangeInput.increment(); 32 await waitForAndExpectIntValue(75); 33 34 rangeInput.increment(); 35 await waitForAndExpectIntValue(100); 36 37 rangeInput.increment(); 38 await waitForAndExpectIntValue(100); 39 40 rangeInput.decrement(); 41 await waitForAndExpectIntValue(75); 42 43 rangeInput.decrement(); 44 await waitForAndExpectIntValue(50); 45 46 rangeInput.decrement(); 47 await waitForAndExpectIntValue(25); 48 49 rangeInput.decrement(); 50 await waitForAndExpectIntValue(0); 51 52 rangeInput.decrement(); 53 await waitForAndExpectIntValue(0); 54 55 finishJSTest(); 56 }, 0); 57 } 53 58 </script> 54 55 <script src="../resources/js-test-post.js"></script>56 59 </body> 57 60 </html> 61 -
trunk/LayoutTests/accessibility/spinbutton-value-expected.txt
r127882 r285778 1 2 423 1 This tests that a spin button supports range value attributes. 4 2 … … 6 4 7 5 8 PASS endsWith( axSpin.intValue, '5') is true9 PASS endsWith( axSpin.minValue, '1') is true10 PASS endsWith( axSpin.maxValue, '9') is true11 PASS endsWith( axSpin.valueDescription, '5 of 9') is true12 PASS axSpin.title is axUntitled.title6 PASS endsWith(spinbutton.intValue, '5') is true 7 PASS endsWith(spinbutton.minValue, '1') is true 8 PASS endsWith(spinbutton.maxValue, '9') is true 9 PASS endsWith(spinbutton.valueDescription, '5 of 9') is true 10 PASS spinbutton.title is untitledButton.title 13 11 PASS successfullyParsed is true 14 12 15 13 TEST COMPLETE 16 14 15 42 -
trunk/LayoutTests/accessibility/spinbutton-value.html
r217171 r285778 1 <!DOCTYPE HTML >1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> 2 2 <html> 3 <head> 4 <script src="../resources/js-test.js"></script> 5 <script src="../resources/accessibility-helper.js"></script> 6 </head> 3 7 <body> 4 <script src="../resources/js-test.js"></script>5 8 6 <button id="untitled "></button>9 <button id="untitledButton"></button> 7 10 8 <div id="spin "11 <div id="spinbutton" 9 12 tabindex="0" 10 13 role="spinbutton" … … 14 17 aria-valuenow="5">42</div> 15 18 16 <div id="console"></div>17 19 <script> 18 description("This tests that a spin button supports range value attributes.") 20 description("This tests that a spin button supports range value attributes."); 19 21 20 if (window.testRunner && window.accessibilityController) {21 22 function endsWith(str, suffix) { 22 str = ''+ str;23 str = "" + str; 23 24 return str.substr(str.length - suffix.length) == suffix; 24 25 } 25 26 26 var untitled = document.getElementById('untitled');27 untitled.focus();28 window.axUntitled = accessibilityController.focusedElement;27 var spinbutton, untitledButton; 28 if (window.accessibilityController) { 29 window.jsTestIsAsync = true; 29 30 30 var spin = document.getElementById('spin'); 31 spin.focus(); 32 window.axSpin = accessibilityController.focusedElement; 31 setTimeout(async function() { 32 untitledButton = await waitForElementById("untitledButton"); 33 spinbutton = await waitForElementById("spinbutton"); 34 await waitForExpression(spinbutton, "intValue", 5); 33 35 34 // Test range value attributes.35 shouldBe("endsWith(axSpin.intValue, '5')", "true");36 shouldBe("endsWith(axSpin.minValue, '1')", "true");37 shouldBe("endsWith(axSpin.maxValue, '9')", "true");38 shouldBe("endsWith(axSpin.valueDescription, '5 of 9')", "true");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"); 39 41 40 // Make sure the title doesn't come from the inner text. It should just be empty if 41 // not otherwise specified. 42 shouldBe("axSpin.title", "axUntitled.title"); 43 } 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"); 44 45 46 finishJSTest(); 47 }, 0); 48 } 45 49 </script> 46 50 </body> 47 51 </html> 52 -
trunk/LayoutTests/resources/accessibility-helper.js
r265248 r285778 111 111 }); 112 112 } 113 114 async function waitForElementById(id) { 115 let element; 116 await waitFor(() => { 117 element = accessibilityController.accessibleElementById(id); 118 return element; 119 }); 120 return element; 121 } 122 123 async function waitForExpression(element, expression, expectedValue) { 124 if (typeof expression !== "string") 125 debug("WARN: The expression arg in waitForExpression() should be a string."); 126 127 await waitFor(() => { 128 return eval(`element.${expression} === ${expectedValue}`); 129 }); 130 } 131
Note:
See TracChangeset
for help on using the changeset viewer.