blob: 5e13b3355d9dbebf2ba3ad36022bdc59cc24e5f7 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
<title>ARIA menuitem Focus</title>
</head>
<body>
<div role="menu">
<div class="item" id="i0" role="menuitem" tabindex="-1">Item 0</div>
<div class="item" id="i1" role="menuitem" tabindex="-1">Item 1</div>
</div>
<p id="description"></p>
<div id="console"></div>
<script>
description("This tests that ARIA menuitems expose AXFocused correctly.");
if (window.accessibilityController) {
var itemCount = document.getElementsByClassName("item").length;
for (var i = 0; i < itemCount; ++i) {
var item = accessibilityController.accessibleElementById("i" + i);
shouldBeTrue("item.isAttributeSupported('AXFocused')");
shouldBeTrue("item.isAttributeSettable('AXFocused')");
shouldBeFalse("item.boolAttributeValue('AXFocused')");
// Set focus.
document.getElementById("i" + i).focus();
shouldBeTrue("item.boolAttributeValue('AXFocused')");
}
}
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>