blob: 4e2c290783908e6c9529d2a36ead5b2f3a69f250 [file] [log] [blame]
<!DOCTYPE HTML>
<html>
<body>
<script src="../resources/js-test-pre.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>
<script src="../resources/js-test-post.js"></script>
</body>
</html>