| <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| <html> |
| <head> |
| <script src="../resources/js-test-pre.js"></script> |
| </head> |
| <body id="body"> |
| |
| |
| <input type="text" id="text1" aria-invalid="true"> |
| <input type="text" id="text2" aria-invalid="grammar"> |
| <input type="text" id="text3" aria-invalid="spelling"> |
| <input type="text" id="text4" aria-invalid="notallowed"> |
| <input type="text" id="text5" aria-invalid="false"> |
| <input type="text" id="text6" aria-invalid=""> |
| <input type="text" id="text7"> |
| |
| <p id="description"></p> |
| <div id="console"></div> |
| <div id="notifications"></div> |
| |
| <script> |
| |
| description("This tests that aria-invalid causes the right attribute to be returned and it ensures a notification is sent when it changes."); |
| |
| var notificationElement = 0; |
| function notificationCallback(notification) { |
| if (notification == "AXInvalidStatusChanged") { |
| document.getElementById("notifications").innerHTML += "Notification received successfully."; |
| notificationElement.removeNotificationListener(); |
| window.testRunner.notifyDone(); |
| } |
| } |
| |
| if (window.accessibilityController) { |
| window.testRunner.waitUntilDone(); |
| |
| document.getElementById("text1").focus(); |
| shouldBe("accessibilityController.focusedElement.stringAttributeValue('AXInvalid')", "'true'"); |
| |
| document.getElementById("text2").focus(); |
| shouldBe("accessibilityController.focusedElement.stringAttributeValue('AXInvalid')", "'grammar'"); |
| |
| document.getElementById("text3").focus(); |
| shouldBe("accessibilityController.focusedElement.stringAttributeValue('AXInvalid')", "'spelling'"); |
| |
| document.getElementById("text4").focus(); |
| shouldBe("accessibilityController.focusedElement.stringAttributeValue('AXInvalid')", "'true'"); |
| |
| document.getElementById("text5").focus(); |
| shouldBe("accessibilityController.focusedElement.stringAttributeValue('AXInvalid')", "'false'"); |
| |
| document.getElementById("text6").focus(); |
| shouldBe("accessibilityController.focusedElement.stringAttributeValue('AXInvalid')", "'false'"); |
| |
| document.getElementById("text7").focus(); |
| shouldBe("accessibilityController.focusedElement.stringAttributeValue('AXInvalid')", "'false'"); |
| |
| notificationElement = accessibilityController.focusedElement; |
| var addedNotification = notificationElement.addNotificationListener(notificationCallback); |
| shouldBeTrue("addedNotification"); |
| |
| document.getElementById("text7").setAttribute("aria-invalid", "spelling"); |
| } |
| |
| </script> |
| |
| <script src="../resources/js-test-post.js"></script> |
| </body> |
| </html> |