blob: ce53ed052221db80f09ed174ee2aadee69f98b12 [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 id="tree" role="tree">
<div id="treeitem_notchecked" role="treeitem">item</div>
<div id="treeitem" role="treeitem" aria-checked="true">item</div>
</div>
<p id="description"></p>
<div id="console"></div>
<script>
var webArea;
var treeItem;
function notificationCallback(notification, userInfo) {
if (notification == "AXValueChanged") {
debug("final tree item value: " + treeItem.intValue);
treeItem.removeNotificationListener();
finishJSTest();
}
}
description("This tests that aria-checked is supported on tree items and changes generate notifications.");
if (window.accessibilityController) {
jsTestIsAsync = true;
webArea = accessibilityController.rootElement.childAtIndex(0);
treeItem = accessibilityController.accessibleElementById("treeitem");
var addedNotification = treeItem.addNotificationListener(notificationCallback);
shouldBe("addedNotification", "true");
var treeItemNotChecked = accessibilityController.accessibleElementById("treeitem_notchecked");
debug("tree item not checked: value attribute supported: " + treeItemNotChecked.isAttributeSupported('AXValue'));
debug("value attribute supported: " + treeItem.isAttributeSupported('AXValue'));
debug("initial tree item value: " + treeItem.intValue);
document.getElementById("treeitem").ariaChecked = "false";
}
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>