JS Test Harness: Remove more link tags
[WebKit-https.git] / LayoutTests / accessibility / menu-list-sends-change-notification.html
1 <html>
2 <head>
3 <script src="../fast/js/resources/js-test-pre.js"></script>
4 <script>
5     if (window.layoutTestController)
6         layoutTestController.waitUntilDone();
7
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.");
10
11         var menulist = document.getElementById("menulist");
12         menulist.focus();
13         var accessibleMenulist = accessibilityController.focusedElement;
14
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.layoutTestController)
20                 layoutTestController.notifyDone();
21         }
22         accessibleMenulist.addNotificationListener(listener);
23
24         // Change the selected index.
25         menulist.selectedIndex = 1;
26
27         // Make the test finish quickly whether we get the notification or not.
28         window.setTimeout(function() {
29             if (window.layoutTestController)
30                 layoutTestController.notifyDone();
31         }, 10);
32     }
33
34     if (window.layoutTestController && window.accessibilityController) {
35         window.addEventListener('load', function() {
36             setTimeout(runTest, 10);
37         }, false);
38     }
39 </script>
40 </head>
41 <body>
42
43 <select id="menulist">
44   <option selected>One</option>
45   <option>Two</option>
46   <option>Three</option>
47 </select>
48
49 <p id="description"></p>
50 <div id="console"></div>
51
52 </body>
53 </html>