b32430d9acbe8a5fae2686cce4382b5cf7e406a8
[WebKit-https.git] / LayoutTests / accessibility / aria-checkbox-text.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script>
5 var successfullyParsed = false;
6 </script>
7 <script src="../fast/js/resources/js-test-pre.js"></script>
8 </head>
9 <body id="body">
10
11 <div role="radiobuttongroup">
12         <div role="checkbox" id="check1" tabindex="0" aria-checked="true">One</div>
13         <div role="checkbox" id="check2" tabindex="0">Two</div>
14         <div role="checkbox" id="check3" tabindex="0" id="foo" aria-labelledby="foo">Three</div>
15 </div>
16
17 <p id="description"></p>
18 <div id="console"></div>
19
20 <script>
21
22     description("This tests that ARIA checkboxes use accessible name computation.");
23
24     if (window.accessibilityController) {
25
26           var checkbox = document.getElementById("check1");
27           checkbox.focus();
28           checkbox = accessibilityController.focusedElement;
29           shouldBe("checkbox.title", "'AXTitle: One'");
30
31           checkbox = document.getElementById("check2");
32           checkbox.focus();
33           checkbox = accessibilityController.focusedElement;
34           shouldBe("checkbox.title", "'AXTitle: Two'");
35
36           checkbox = document.getElementById("check3");
37           checkbox.focus();
38           checkbox = accessibilityController.focusedElement;
39           shouldBe("checkbox.title", "'AXTitle: Three'");
40     }
41
42     successfullyParsed = true;
43 </script>
44
45 <script src="../fast/js/resources/js-test-post.js"></script>
46 </body>
47 </html>