Changeset 271453 in webkit
- Timestamp:
- Jan 13, 2021, 1:22:19 PM (6 years ago)
- Location:
- trunk/LayoutTests
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
accessibility/mac/details-summary-expected.txt (modified) (2 diffs)
-
accessibility/mac/details-summary.html (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r271451 r271453 1 2021-01-13 Andres Gonzalez <andresg_22@apple.com> 2 3 Fix for LayoutTests/accessibility/mac/details-summary.html in isolated tree mode. 4 https://bugs.webkit.org/show_bug.cgi?id=220597 5 6 Reviewed by Chris Fleizach. 7 8 - Use Promises to wait for the expanded state change. 9 - Added a comment to clarify why it is necessary to fetch a new 10 accessible object by ID every time after setting the AXExpanded 11 attribute for <details> elements. 12 13 * accessibility/mac/details-summary-expected.txt: 14 The order in which the notifications come through changed. 15 * accessibility/mac/details-summary.html: 16 1 17 2021-01-13 Rob Buis <rbuis@igalia.com> 2 18 -
trunk/LayoutTests/accessibility/mac/details-summary-expected.txt
r267644 r271453 18 18 PASS summary1.title is 'AXTitle: Some open info' 19 19 PASS details1.isAttributeSettable('AXExpanded') is true 20 Received AXExpandedChanged notification 20 21 PASS details1.isExpanded is false 21 22 PASS summary1.isExpanded is false 22 23 PASS details1.isExpanded is false 23 24 PASS summary1.isExpanded is false 25 Received AXExpandedChanged notification 24 26 PASS details1.isExpanded is true 25 27 PASS summary1.isExpanded is true … … 30 32 PASS details3.subrole is 'AXSubrole: AXApplicationGroup' 31 33 PASS details3.isExpanded is true 32 Received AXExpandedChanged notification33 Received AXExpandedChanged notification34 34 PASS successfullyParsed is true 35 35 -
trunk/LayoutTests/accessibility/mac/details-summary.html
r232285 r271453 3 3 <head> 4 4 <script src="../../resources/js-test-pre.js"></script> 5 <script src="../../resources/accessibility-helper.js"></script> 5 6 </head> 6 7 <body id="body"> … … 25 26 26 27 <script> 27 28 28 description("This tests some basic attributes about the details element."); 29 29 30 var callbackCount = 0;31 30 if (window.accessibilityController) { 32 31 window.jsTestIsAsync = true; … … 34 33 var body = accessibilityController.rootElement.childAtIndex(0); 35 34 body.addNotificationListener(function(notification) { 36 if (notification == "AXExpandedChanged") { 37 callbackCount++; 35 if (notification == "AXExpandedChanged") 38 36 debug("Received " + notification + " notification "); 39 40 if (callbackCount == 2) {41 finishJSTest();42 }43 }44 37 }); 45 38 … … 56 49 // Toggle the expanded state. 57 50 details1.setBoolAttributeValue("AXExpanded", false); 51 52 // After toggling the expanded state on a <details> element, the underlying HTMLDetailsElement goes away and it is replaced by a new object. 53 // Thus, we need to retrieve the corresponding accessible object again since the current one becomes defunct. 54 // See HTMLDetailsElement::toggleOpen(). 55 setTimeout(async function() { 56 await waitFor(() => { 58 57 details1 = accessibilityController.accessibleElementById("details1"); 58 return !details1.isExpanded; 59 }); 59 60 summary1 = accessibilityController.accessibleElementById("summary1"); 60 61 shouldBeFalse("details1.isExpanded"); … … 63 64 // Give it the same value to make sure we don't expand. 64 65 details1.setBoolAttributeValue("AXExpanded", false); 66 await waitFor(() => { 65 67 details1 = accessibilityController.accessibleElementById("details1"); 68 return !details1.isExpanded; 69 }); 66 70 summary1 = accessibilityController.accessibleElementById("summary1"); 67 71 shouldBeFalse("details1.isExpanded"); … … 70 74 // Set to expand again. 71 75 details1.setBoolAttributeValue("AXExpanded", true); 76 await waitFor(() => { 72 77 details1 = accessibilityController.accessibleElementById("details1"); 78 return details1.isExpanded; 79 }); 73 80 summary1 = accessibilityController.accessibleElementById("summary1"); 74 81 shouldBeTrue("details1.isExpanded"); … … 77 84 // And duplicate the true state to make sure it doesn't toggle off. 78 85 details1.setBoolAttributeValue("AXExpanded", true); 86 await waitFor(() => { 79 87 details1 = accessibilityController.accessibleElementById("details1"); 88 return details1.isExpanded; 89 }); 80 90 summary1 = accessibilityController.accessibleElementById("summary1"); 81 91 shouldBeTrue("details1.isExpanded"); 82 92 shouldBeTrue("summary1.isExpanded"); 83 93 84 vardetails2 = accessibilityController.accessibleElementById("details2");94 details2 = accessibilityController.accessibleElementById("details2"); 85 95 shouldBe("details2.subrole", "'AXSubrole: AXDetails'"); 86 96 shouldBeFalse("details2.isExpanded"); 87 97 88 98 // Expanded status should be correct when detail has group role 89 vardetails3 = accessibilityController.accessibleElementById("details3");99 details3 = accessibilityController.accessibleElementById("details3"); 90 100 shouldBe("details3.subrole", "'AXSubrole: AXApplicationGroup'"); 91 101 shouldBeTrue("details3.isExpanded"); 102 103 finishJSTest(); 104 }, 0); 92 105 } 93 94 106 </script> 95 96 107 <script src="../../resources/js-test-post.js"></script> 97 108 </body>
Note:
See TracChangeset
for help on using the changeset viewer.