blob: d75184dcc04c6d5b35b460bbd505fd1e25b7dc79 [file] [log] [blame]
<!DOCTYPE HTML>
<html>
<body>
<script src="../resources/js-test.js"></script>
<canvas id="canvas"></canvas>
<div id="console"></div>
<script>
description("This test makes sure that AccessibilityObjects are detached when the node they point to is detached.");
if (window.testRunner && window.accessibilityController) {
window.testRunner.dumpAsText();
// Create a button on the page, focus it and get its accessibility role.
var button = document.createElement('button');
document.body.appendChild(button);
button.focus();
window.axElement = accessibilityController.focusedElement;
window.expectedButtonRole = axElement.role;
// Now remove the node from the tree and get the role of the detached accessibility object.
// We detect that it's detached just by checking that the role is different (empty or unknown).
document.body.removeChild(button);
window.expectedDetachedRole = axElement.role;
shouldBeTrue("expectedButtonRole != expectedDetachedRole");
}
</script>
</body>
</html>