1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
4 <script src="../../../fast/js/resources/js-test-pre.js"></script>
8 <ul id="tree0" role="tree" aria-labelledby="treelabel" aria-activedescendant="tree0_item0_2_0_1" tabindex="0">
9 <li id="tree0_item0" role="treeitem" aria-level="1" aria-expanded="true">
11 <span class="expander"></span>
15 <li id="tree0_item0_0" role="treeitem" aria-level="2"><span>Birds</span></li>
20 <p id="description"></p>
21 <div id="console"></div>
22 <div id="notifications"></div>
26 description("This tests that when aria-expanded is toggled, the appropriate notifications are sent out");
31 // The order of notifications should be Row Count, Row Collapsed, Row Count, Row Expanded
32 function notifyCallback(notification) {
33 notifyName = notification;
34 document.getElementById("notifications").innerHTML += "Notification: " + notifyName + "<br>";
35 if (notifyCount == 3) {
36 axTree.removeNotificationListener();
37 window.layoutTestController.notifyDone();
42 if (window.accessibilityController) {
43 window.layoutTestController.waitUntilDone();
45 var domTree = document.getElementById("tree0");
48 axTree = window.accessibilityController.focusedElement;
50 var addedNotification = axTree.addNotificationListener(notifyCallback);
51 shouldBe("addedNotification", "true");
53 // the first aria-expanded should generate row count, row collapsed.
54 document.getElementById("tree0_item0").setAttribute("aria-expanded", "false");
56 // the second aria-expanded should generate row count, row expanded.
57 document.getElementById("tree0_item0").setAttribute("aria-expanded", "true");
62 <script src="../../../fast/js/resources/js-test-post.js"></script>