Refactoring: Pull all fullscreen code out of Document and into its own helper class
[WebKit-https.git] / LayoutTests / accessibility / aria-checkbox-sends-notification.html
1 <html>
2 <head>
3 <script src="../resources/js-test.js"></script>
4 <script>
5     function runTest() {
6         jsTestIsAsync = true;
7
8         description("This tests that checking of an aria checkbox sends a notification.");
9
10         var accessibleCheckbox = accessibilityController.accessibleElementById("checkbox1");
11         var notificationCount = 0;
12
13         function listener(notification) {
14             if (notification == "CheckedStateChanged")
15                 notificationCount++;
16
17             document.getElementById("console").innerText += "Got notification: " + notification + "\n";
18
19             if (notificationCount == 2) {
20                 accessibleCheckbox.removeNotificationListener(listener);
21                 finishJSTest();
22             }
23         }
24         accessibleCheckbox.addNotificationListener(listener);
25
26         // Check the checkbox.
27         document.getElementById('checkbox1').setAttribute('aria-checked', 'true');
28         document.getElementById('checkbox1').setAttribute('aria-checked', 'false');
29     };
30 </script>
31 </head>
32 <body onload="runTest()">
33
34 <div id="checkbox1" tabindex=0 role="checkbox" aria-checked="false">Test Checkbox</div>
35
36 <p id="description"></p>
37 <div id="console"></div>
38 </body>
39 </html>