Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / accessibility / menu-list-sends-change-notification.html
blobe65bbd2381d58ebe899ea162cea162dbb49a29fa
1 <html>
2 <head>
3 <script src="../resources/js-test.js"></script>
4 <script>
5 if (window.testRunner)
6 testRunner.waitUntilDone();
8 function runTest() {
9 description("This tests that changing the value of a menu list sends a notification even when it's not popped open.");
11 var menulist = document.getElementById("menulist");
12 menulist.focus();
13 var accessibleMenulist = accessibilityController.focusedElement;
15 function listener(notification) {
16 document.getElementById("console").innerText += "Got notification: " + notification + "\n";
17 accessibleMenulist.removeNotificationListener(listener);
18 debug('<br /><span class="pass">TEST COMPLETE</span>');
19 if (window.testRunner)
20 testRunner.notifyDone();
22 accessibleMenulist.addNotificationListener(listener);
24 // Change the selected index.
25 menulist.selectedIndex = 1;
27 // Make the test finish quickly whether we get the notification or not.
28 window.setTimeout(function() {
29 if (window.testRunner)
30 testRunner.notifyDone();
31 }, 10);
34 if (window.testRunner && window.accessibilityController) {
35 window.addEventListener('load', function() {
36 setTimeout(runTest, 10);
37 }, false);
39 </script>
40 </head>
41 <body>
43 <select id="menulist">
44 <option selected>One</option>
45 <option>Two</option>
46 <option>Three</option>
47 </select>
49 <p id="description"></p>
50 <div id="console"></div>
52 </body>
53 </html>