44 lines
1.3 KiB
HTML
44 lines
1.3 KiB
HTML
<html>
|
|
<head>
|
|
<script src="../../resources/js-test-pre.js"></script>
|
|
</head>
|
|
<body>
|
|
<div id="content" role="list" tabindex="0">
|
|
<div id="item1" role="listitem">1</div>
|
|
<div id="item2" role="listitem" aria-current="page">2</div>
|
|
<div id="item3" role="listitem">3</div>
|
|
</div>
|
|
|
|
<p id="description"></p>
|
|
<div id="console"></div>
|
|
<script>
|
|
window.jsTestIsAsync = true;
|
|
description("This tests that changing the aria-current value results in a state-changed notification.");
|
|
|
|
if (window.testRunner && window.accessibilityController) {
|
|
accessibilityController.addNotificationListener(function(element, notification) {
|
|
if (notification != "ActiveStateChanged")
|
|
return;
|
|
debug(notification + ": " + element.title + " " + element.role);
|
|
});
|
|
|
|
document.getElementById("content").focus();
|
|
|
|
debug("Setting aria-current to false on item2.");
|
|
document.getElementById("item2").setAttribute("aria-current", "false");
|
|
|
|
debug("Setting aria-current to page on item3.");
|
|
document.getElementById("item3").setAttribute("aria-current", "page");
|
|
|
|
document.getElementById("content").style.visibility = "hidden";
|
|
|
|
window.setTimeout(function() {
|
|
accessibilityController.removeNotificationListener();
|
|
finishJSTest();
|
|
}, 0);
|
|
}
|
|
</script>
|
|
<script src="../../resources/js-test-post.js"></script>
|
|
</body>
|
|
</html>
|