blob: 65225cce7a5f2ba1f27f59c3a52e557d7126ed18 [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">
Test
</div>
<p id="description"></p>
<div id="console"></div>
<script>
description("This tests that ARIA live region notifications are sent even when an assistive technology is not accessing them directly on each update.");
if (window.accessibilityController) {
window.testRunner.waitUntilDone();
document.getElementById("liveregion").focus();
liveRegion = window.accessibilityController.focusedElement;
var liveRegionChangeCount = 0;
function ariaCallback(notification) {
if (notification == "AXLiveRegionChanged") {
liveRegionChangeCount++;
if (liveRegionChangeCount == 3) {
liveRegion.removeNotificationListener();
window.testRunner.notifyDone();
}
}
}
var addedNotification = liveRegion.addNotificationListener(ariaCallback);
shouldBe("addedNotification", "true");
// this should trigger our live region callback for a new element.
for (var k = 0; k < 3; k++) {
var textNode = document.createTextNode("test" + k);
document.getElementById("liveregion").appendChild(textNode);
}
}
</script>
<script src="../../../resources/js-test-post.js"></script>
</body>
</html>