|
Line 0
a/LayoutTests/platform/mac/accessibility/textbox-role-reports-notifications.html_sec1
|
|
|
1 |
<!DOCTYPE HTML PUBLIC> |
| 2 |
<html> |
| 3 |
<head> |
| 4 |
<link rel="stylesheet" href="../fast/js/resources/js-test-style.css"> |
| 5 |
<script> |
| 6 |
var successfullyParsed = false; |
| 7 |
</script> |
| 8 |
<script src="../fast/js/resources/js-test-pre.js"></script> |
| 9 |
</head> |
| 10 |
<body> |
| 11 |
This tests that the AXValueChanged notification is correctly reported for non-native text boxes when content is changed.<br> |
| 12 |
<div role="textbox" id="ariaTextBox" aria-multiline="false" tabindex="0">Some text in a textbox.</div> |
| 13 |
<div id="console"></div> |
| 14 |
<script> |
| 15 |
if (window.layoutTestController && window.accessibilityController) { |
| 16 |
window.layoutTestController.waitUntilDone(); |
| 17 |
|
| 18 |
accessibilityController.logAccessibilityEvents(); |
| 19 |
window.layoutTestController.dumpAsText(); |
| 20 |
|
| 21 |
var ariaTextBox = document.getElementById("ariaTextBox"); |
| 22 |
ariaTextBox.focus(); |
| 23 |
var textboxAxElement = accessibilityController.focusedElement; |
| 24 |
textboxAxElement.addNotificationListener(logNotification); |
| 25 |
pendingNotifications = 3; |
| 26 |
ariaTextBox.firstChild.deleteData(0, 5); |
| 27 |
ariaTextBox.textContent = "changed textContent"; |
| 28 |
ariaTextBox.innerText = "changed innerText"; |
| 29 |
} |
| 30 |
|
| 31 |
function logNotification(notification) { |
| 32 |
if (notification == "AXValueChanged") { |
| 33 |
alert("Successfully received AXValueChanged."); |
| 34 |
pendingNotifications--; |
| 35 |
if (pendingNotifications == 0) { |
| 36 |
textboxAxElement.removeNotificationListener(); |
| 37 |
window.layoutTestController.notifyDone(); |
| 38 |
} |
| 39 |
} |
| 40 |
} |
| 41 |
|
| 42 |
successfullyParsed = true; |
| 43 |
</script> |
| 44 |
|
| 45 |
<script src="../fast/js/resources/js-test-post.js"></script> |
| 46 |
</body> |
| 47 |
</html> |