blob: df5792ec268deb551482bfcfa073fc8d0a822573 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="../../resources/js-test.js"></script>
</head>
<body>
<div>This tests that the AXValueChanged notification is correctly reported for non-native text boxes when content is changed.</div>
<div role="textbox" id="ariaTextBox" aria-multiline="false" tabindex="0">Some text in a textbox.</div>
<div id="console"</div>
<script>
var textboxAxElement;
if (window.testRunner && window.accessibilityController) {
jsTestIsAsync = true;
accessibilityController.logAccessibilityEvents();
var ariaTextBox = document.getElementById("ariaTextBox");
ariaTextBox.focus();
textboxAxElement = accessibilityController.focusedElement;
textboxAxElement.addNotificationListener(logNotification);
pendingNotifications = 3;
ariaTextBox.firstChild.deleteData(0, 5);
ariaTextBox.offsetWidth;
ariaTextBox.textContent = "changed textContent";
ariaTextBox.offsetWidth;
ariaTextBox.innerText = "changed innerText";
}
function logNotification(notification) {
if (notification == "AXValueChanged") {
debug("Successfully received AXValueChanged.");
pendingNotifications--;
if (pendingNotifications == 0) {
textboxAxElement.removeNotificationListener();
finishJSTest();
}
}
}
</script>
</body>
</html>