blob: d8de2c0e7a472ff089d4ec795cd05fd18a9a3541 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../resources/js-test.js"></script>
<script src="../resources/accessibility-helper.js"></script>
</head>
<body id="body">
<fieldset id="fieldset">
<legend>Choose a shipping method:</legend>
<div role="group"><input id="overnight" type="radio" name="shipping" value="overnight" />Overnight</div>
</fieldset>
<div>End of test</div>
<p id="description"></p>
<div id="console"></div>
<script>
description("This tests that a fieldset's title ui element is the legend.");
if (window.accessibilityController) {
var fieldset = accessibilityController.accessibleElementById("fieldset");
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(accessibilityController.rootElement, 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("titleUIElementText.name", "'Choose a shipping method:'");
}
</script>
</body>
</html>