Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / accessibility / aria-checkbox-sends-notification.html
blob557417d8527f0dd52f3c5dbc6e0b2406fce2353b
1 <html>
2 <head>
3 <script src="../resources/js-test.js"></script>
4 <script>
5 function runTest() {
6 window.jsTestIsAsync = true;
8 description("This tests that checking of an aria checkbox sends a notification.");
10 var accessibleCheckbox = accessibilityController.accessibleElementById("checkbox1");
11 var notificationCount = 0;
13 function listener(notification) {
14 if (notification == "CheckedStateChanged")
15 notificationCount++;
17 debug("Got notification: " + notification);
19 if (notificationCount == 2) {
20 accessibleCheckbox.removeNotificationListener(listener);
21 finishJSTest();
24 accessibleCheckbox.addNotificationListener(listener);
26 // Check the checkbox.
27 document.getElementById('checkbox1').setAttribute('aria-checked', 'true');
28 document.getElementById('checkbox1').setAttribute('aria-checked', 'false');
30 </script>
31 </head>
32 <body>
34 <div id="checkbox1" tabindex=0 role="checkbox" aria-checked="false">Test Checkbox</div>
36 <p id="description"></p>
37 <div id="console"></div>
38 <script>
39 runTest();
40 </script>
41 </body>
42 </html>