Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / accessibility / legend.html
blobb37751734c53b0032b140d4acd343b10817d7f88
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../resources/js-test.js"></script>
5 <script src="../resources/accessibility-helper.js"></script>
6 </head>
7 <body id="body">
9 <fieldset>
10 <legend>Choose a shipping method:</legend>
11 <input id="overnight" type="radio" name="shipping" value="overnight" />Overnight
12 </fieldset>
14 <div>End of test</div>
16 <p id="description"></p>
17 <div id="console"></div>
19 <script>
21 description("This tests that a fieldset's title ui element is the legend.");
23 if (window.accessibilityController) {
24 document.body.focus();
25 var body = accessibilityController.focusedElement;
26 var fieldset = body.childAtIndex(0);
27 var titleUIElement = fieldset.deprecatedTitleUIElement();
29 // Print out the tree of accessible objects, indicating the titleUIElement so
30 // that each platform can verify their expected object has been found
31 buildAccessibilityTree(body, 0, 0, 0, titleUIElement, "<< fieldset's titleUIElement");
33 // Verify that we have gotten the titleUIElement and it has the expected text,
34 // which should be in the last descendant regardless of platform.
35 shouldBeTrue("titleUIElement != null");
36 var titleUIElementText = titleUIElement;
37 while (titleUIElementText && titleUIElementText.childrenCount)
38 titleUIElementText = titleUIElementText.childAtIndex(0);
40 shouldBe("titleUIElementText.stringValue", "'AXValue: Choose a shipping method:'");
42 </script>
44 </body>
45 </html>