4 <script src="../fast/js/resources/js-test-pre.js"></script>
8 <div role="group" tabindex="0" id="parent">
9 <div role="button" id="button1" tabindex="0">Button 1</div>
10 <div role="button" id="button2" tabindex="0">Button 2</div>
11 <div role="button" id="button3" tabindex="0">Button 3</div>
16 <p id="description"></p>
17 <div id="console"></div>
20 if (window.accessibilityController) {
21 description("This test makes sure that when aria-hidden changes, the AX hierarchy is updated.");
23 // Get the parent element.
24 document.getElementById("parent").focus();
25 var parent = accessibilityController.focusedElement;
27 // Get all three children.
28 document.getElementById("button1").focus();
29 var button1 = accessibilityController.focusedElement;
30 document.getElementById("button2").focus();
31 var button2 = accessibilityController.focusedElement;
32 document.getElementById("button3").focus();
33 var button3 = accessibilityController.focusedElement;
35 // Verify that the 3 children are present.
36 shouldBeTrue("parent.childAtIndex(0).isEqual(button1)");
37 shouldBeTrue("parent.childAtIndex(1).isEqual(button2)");
38 shouldBeTrue("parent.childAtIndex(2).isEqual(button3)");
40 // Make the 2nd button hidden. Only 1 and 3 should be present.
41 document.getElementById("button2").setAttribute("aria-hidden", "true");
42 shouldBeTrue("parent.childAtIndex(0).isEqual(button1)");
43 shouldBeTrue("parent.childAtIndex(1).isEqual(button3)");
45 // Make the 1st button hidden. Only 3 should be present.
46 document.getElementById("button1").setAttribute("aria-hidden", "true");
47 shouldBeTrue("parent.childAtIndex(0).isEqual(button3)");
49 // Make the 2nd button not hidden. 2 and 3 should be present.
50 document.getElementById("button2").setAttribute("aria-hidden", "false");
51 shouldBeTrue("parent.childAtIndex(0).isEqual(button2)");
52 shouldBeTrue("parent.childAtIndex(1).isEqual(button3)");
57 <script src="../fast/js/resources/js-test-post.js"></script>