blob: dc7b832dcd1444d9342ba837dd943225eb61f42d [file] [log] [blame]
<script src="../resources/js-test.js"></script>
<script src="../resources/accessibility-helper.js"></script>
<body id="body">
<legend>Choose a shipping method:</legend>
<input id="overnight" type="radio" name="shipping" value="overnight" />Overnight
<div>End of test</div>
<p id="description"></p>
<div id="console"></div>
description("This tests that a fieldset's title ui element is the legend.");
if (window.accessibilityController) {
var body = accessibilityController.focusedElement;
var fieldset = body.childAtIndex(0);
var titleUIElement = fieldset.nameElementAtIndex(0);
// Print out the tree of accessible objects, indicating the titleUIElement so
// that each platform can verify their expected object has been found
buildAccessibilityTree(body, 0, 0, 0, titleUIElement, "<< fieldset's titleUIElement");
// Verify that we have gotten the titleUIElement and it has the expected text,
// which should be in the last descendant regardless of platform.
shouldBeTrue("titleUIElement != null");
var titleUIElementText = titleUIElement;
while (titleUIElementText && titleUIElementText.childrenCount)
titleUIElementText = titleUIElementText.childAtIndex(0);
shouldBe("", "'Choose a shipping method:'");