| <html> |
| <head> |
| <script src="../../resources/js-test-pre.js"></script> |
| </head> |
| <body> |
| <div id="textbox1" role="textbox" aria-disabled="false" tabindex="0"></div> |
| <div id="textbox2" role="textbox" aria-disabled="true" tabindex="0"></div> |
| <p id="description"></p> |
| <div id="console"></div> |
| <script> |
| window.jsTestIsAsync = true; |
| description("This tests that changing the aria-disabled value results in a state-changed notification."); |
| |
| if (window.testRunner && window.accessibilityController) { |
| accessibilityController.addNotificationListener(function(element, notification, state) { |
| if (notification == "AXDisabledStateChanged") { |
| // The platform notification is for STATE_ENABLED. |
| debug(notification + " " + (state != "1") + " on " + element.stringAttributeValue("html-id")); |
| return; |
| } |
| |
| if (notification == "AXSensitiveStateChanged") |
| debug(notification + " " + (state == "1") + " on " + element.stringAttributeValue("html-id")); |
| }); |
| |
| var element = document.getElementById("textbox1"); |
| element.focus(); |
| debug("Setting aria-disabled to true on textbox1."); |
| element.setAttribute("aria-disabled", "true"); |
| |
| element = document.getElementById("textbox2"); |
| element.focus(); |
| debug("Setting aria-disabled to false on textbox2."); |
| element.setAttribute("aria-disabled", "false"); |
| |
| window.setTimeout(function() { |
| accessibilityController.removeNotificationListener(); |
| finishJSTest(); |
| }, 0); |
| } |
| </script> |
| <script src="../../resources/js-test-post.js"></script> |
| </body> |
| </html> |