blob: d0b7d0db00bcc770cf1b2f4421f7ee2cc670bc38 [file] [log] [blame]
<!DOCTYPE HTML>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<select id="listbox" size="3">
<option id="item0">Alicia</option>
<option id="item1">Peter</option>
<option id="item2">Kalinda</option>
</select>
<script>
async_test(function(t)
{
var listbox = document.getElementById("listbox");
listbox.selectedIndex = 0;
listbox.focus();
accessibilityController.accessibleElementById('dummy');
var gotCheckedStateChanged = false;
var gotSelectedChildrenChanged = false;
window.setTimeout(function() {
var result = "";
accessibilityController.addNotificationListener(t.step_func(function listener(element, notification) {
if (notification == "CheckedStateChanged") {
assert_equals(element.role, "AXRole: AXListBoxOption");
gotCheckedStateChanged = true;
}
if (notification == "SelectedChildrenChanged") {
assert_equals(element.role, "AXRole: AXListBox");
gotSelectedChildrenChanged = true;
}
if (gotCheckedStateChanged && gotSelectedChildrenChanged) {
t.done();
}
}));
listbox.selectedIndex = 1;
}, 0);
}, "menu list fires correct events when active index changes.");
</script>