blob: 542ac3c4fab090c8349c4b09721ca9cffd028354 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
<script>
if (window.testRunner)
testRunner.dumpAsText();
</script>
</head>
<body>
<div id="parent" tabindex=0 role="group">
<span role="button" id="button1">button 1</span>
<span id="button2" title="button 2"></span>
</div>
<p id="description"></p>
<div id="console"></div>
<script>
description("This tests that when an ARIA role changes, the AX hierarchy is updated accordingly.");
if (window.accessibilityController) {
document.getElementById("parent").focus();
var parent = accessibilityController.focusedElement;
shouldBe("parent.childAtIndex(0).role", "'AXRole: AXButton'");
shouldBeTrue("parent.childAtIndex(1) == null || parent.childAtIndex(1).isValid == false");
document.getElementById("button1").removeAttribute("role");
document.getElementById("button2").setAttribute("role", "button");
shouldBe("parent.childAtIndex(0).role", "'AXRole: AXStaticText'");
shouldBe("parent.childAtIndex(1).role", "'AXRole: AXButton'");
}
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>