blob: 55123236374bb279f36dd8c7891b3e5473680bca [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../../resources/js-test-pre.js"></script>
</head>
<body id="body">
<div role="group" tabindex=0 id="liveregion" aria-live="polite" aria-relevant="additions">
<h3 id="innerlive">text</h3>
<img src="test.gif" width=100 height=100 alt="alt text" tabindex=0 id="image">
</div>
<p id="description"></p>
<div id="console"></div>
<div id="notifications"></div>
<script>
description("This tests that ARIA removing an element from a live region sends the correct notification.");
var liveRegion = 0;
function ariaCallback(notification) {
if (notification == "AXLiveRegionChanged") {
document.getElementById("notifications").innerHTML += "Successfully received " + notification;
liveRegion.removeNotificationListener();
window.testRunner.notifyDone();
}
}
if (window.accessibilityController) {
window.testRunner.waitUntilDone();
document.getElementById("liveregion").focus();
liveRegion = window.accessibilityController.focusedElement;
var addedNotification = liveRegion.addNotificationListener(ariaCallback);
shouldBe("addedNotification", "true");
// this should trigger our live region callback for a removed element.
document.getElementById("liveregion").removeChild(document.getElementById("innerlive"));
}
</script>
<script src="../../../resources/js-test-post.js"></script>
</body>
</html>