blob: e65bbd2381d58ebe899ea162cea162dbb49a29fa [file] [log] [blame]
<html>
<head>
<script src="../resources/js-test.js"></script>
<script>
if (window.testRunner)
testRunner.waitUntilDone();
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);
debug('<br /><span class="pass">TEST COMPLETE</span>');
if (window.testRunner)
testRunner.notifyDone();
}
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() {
if (window.testRunner)
testRunner.notifyDone();
}, 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>