| <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| <script src="../../resources/js-test-pre.js"></script> |
| <button id="button" aria-expanded="false"> |
| description("This tests that aria-expanded changes will send notifications."); |
| var notificationCount = 0; |
| function ariaCallback(element, notification) { |
| if (notification == "AXExpandedChanged") { |
| debug("Received notification: " + notification); |
| debug("Expanded status: " + element.isExpanded); |
| if (notificationCount == 2) { |
| accessibilityController.removeNotificationListener(); |
| if (window.accessibilityController) { |
| window.jsTestIsAsync = true; |
| var addedNotification = accessibilityController.addNotificationListener(ariaCallback); |
| var button = accessibilityController.accessibleElementById("button"); |
| debug("Initial expanded status: " + button.isExpanded); |
| document.getElementById("button").setAttribute("aria-expanded", "true"); |
| document.getElementById("button").setAttribute("aria-expanded", "false"); |
| <script src="../../resources/js-test-post.js"></script> |