blob: dac0f325e01861637b737be6f88dd2cdff70b0c0 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC>
<html>
<head>
<script src="../../resources/js-test.js"></script>
</head>
<body>
<div id="content">
<input type="text" role="combobox" id="combo" aria-owns="list">
<ul id="list" role="listbox">
<li tabindex="0" role="option" id="item1">item1</li>
</ul>
</div>
<p id="description"></p>
<div id="console"></div>
<script>
description("This test makes sure that an ARIA active descendant change does not change focus, because focus should remain in the textfield portion of the combo box.");
if (window.testRunner && window.accessibilityController) {
jsTestIsAsync = true;
document.getElementById("combo").focus();
var combo = accessibilityController.accessibleElementById("combo");
debug("The ComboBox should start out as the focused element.");
shouldBeTrue("combo.isEqual(accessibilityController.focusedElement)");
// When the active descendant changes, we should receive a selected children changed notification.
combo.addNotificationListener(function(notification) {
debug("Received notification: " + notification);
if (notification == "AXSelectedChildrenChanged") {
combo.removeNotificationListener();
finishJSTest();
}
});
// After the descendant changes, the combo box should still be the focused object.
document.getElementById("combo").setAttribute("aria-activedescendant", "item1");
debug("\nThe ComboBox should still be the focused element even after the aria-activedescendant was changed.");
shouldBeTrue("combo.isEqual(accessibilityController.focusedElement)");
document.getElementById("content").style.visibility = 'hidden';
}
</script>
</body>
</html>