blob: bae903a6e1902e8a30d040874196cb3caca6a122 [file] [log] [blame]
<html>
<head>
<script src="../resources/js-test.js"></script>
<script>
jsTestIsAsync = true;
function runTest() {
description("This tests that changing the value of a menu list sends a notification even when it's not popped open.");
var menulist = document.getElementById("menulist");
menulist.focus();
var accessibleMenulist = accessibilityController.focusedElement;
function listener(notification) {
document.getElementById("console").innerText += "Got notification: " + notification + "\n";
accessibleMenulist.removeNotificationListener(listener);
finishJSTest();
}
accessibleMenulist.addNotificationListener(listener);
// Change the selected index.
menulist.selectedIndex = 1;
// Make the test finish quickly whether we get the notification or not.
window.setTimeout(function() {
finishJSTest();
}, 10);
}
if (window.testRunner && window.accessibilityController) {
window.addEventListener('load', function() {
setTimeout(runTest, 10);
}, false);
}
</script>
</head>
<body>
<select id="menulist">
<option selected>One</option>
<option>Two</option>
<option>Three</option>
</select>
<p id="description"></p>
<div id="console"></div>
</body>
</html>