4 <script src=
"../resources/js-test.js"></script>
7 <option id=
"item0">Alicia
</option>
8 <option id=
"item1">Peter
</option>
9 <option id=
"item2">Kalinda
</option>
12 <div id=
"console"></div>
14 description("This test makes sure menu lists fire events on both the option that lost selection and the one that gained selection.");
15 window
.jsTestIsAsync
= true;
17 if (window
.testRunner
&& window
.accessibilityController
) {
18 window
.testRunner
.dumpAsText();
20 var menulist
= document
.getElementById("menulist");
21 menulist
.selectedIndex
= 0;
23 var axMenuList
= accessibilityController
.accessibleElementById("menulist");
24 var axMenuListPopup
= axMenuList
.childAtIndex(0);
25 shouldBe("axMenuListPopup.role", "\"AXRole: AXMenuListPopup\"");
26 var axMenuListOption
= axMenuListPopup
.childAtIndex(0);
27 shouldBe("axMenuListOption.role", "\"AXRole: AXMenuListOption\"");
29 window
.setTimeout(function() {
31 // Explore the whole accessibility tree. State change events won't fire on accessible objects that haven't
33 accessibilityController
.accessibleElementById('foo');
35 accessibilityController
.addNotificationListener(function(element
, notification
) {
36 if (element
.stringValue
== axMenuListOption
.stringValue
) {
37 window
.element
= element
;
38 shouldBe("element.isEqual(axMenuListOption)", "true");
39 shouldBe("element.parentElement().isEqual(axMenuListPopup)", "true");
44 menulist
.selectedIndex
= 1;