| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> | |
| 2 <html> | |
| 3 <head> | |
| 4 <script src="../fast/js/resources/js-test-pre.js"></script> | |
| 5 </head> | |
| 6 <body id="body"> | |
| 7 | |
| 8 | |
| 9 <input type="text" id="text1" aria-invalid="true"> | |
| 10 <input type="text" id="text2" aria-invalid="grammar"> | |
| 11 <input type="text" id="text3" aria-invalid=""> | |
| 12 <input type="text" id="text4"> | |
| 13 | |
| 14 <p id="description"></p> | |
| 15 <div id="console"></div> | |
| 16 <div id="notifications"></div> | |
| 17 | |
| 18 <script> | |
| 19 | |
| 20 description("This tests that aria-invalid causes the right attribute to be r
eturned and it ensures a notification is sent when it changes."); | |
| 21 | |
| 22 var notificationElement = 0; | |
| 23 function notificationCallback(notification) { | |
| 24 if (notification == "AXInvalidStatusChanged") { | |
| 25 document.getElementById("notifications").innerHTML += "Notification
received successfully."; | |
| 26 notificationElement.removeNotificationListener(); | |
| 27 window.testRunner.notifyDone(); | |
| 28 } | |
| 29 } | |
| 30 | |
| 31 if (window.accessibilityController) { | |
| 32 window.testRunner.waitUntilDone(); | |
| 33 | |
| 34 document.getElementById("text1").focus(); | |
| 35 shouldBe("accessibilityController.focusedElement.stringAttributeValue('A
XInvalid')", "'true'"); | |
| 36 | |
| 37 document.getElementById("text2").focus(); | |
| 38 shouldBe("accessibilityController.focusedElement.stringAttributeValue('A
XInvalid')", "'grammar'"); | |
| 39 | |
| 40 document.getElementById("text3").focus(); | |
| 41 shouldBe("accessibilityController.focusedElement.stringAttributeValue('A
XInvalid')", "'false'"); | |
| 42 | |
| 43 document.getElementById("text4").focus(); | |
| 44 shouldBe("accessibilityController.focusedElement.stringAttributeValue('A
XInvalid')", "'false'"); | |
| 45 | |
| 46 notificationElement = accessibilityController.focusedElement; | |
| 47 var addedNotification = notificationElement.addNotificationListener(noti
ficationCallback); | |
| 48 shouldBeTrue("addedNotification"); | |
| 49 | |
| 50 document.getElementById("text4").setAttribute("aria-invalid", "spelling"
); | |
| 51 } | |
| 52 | |
| 53 </script> | |
| 54 | |
| 55 <script src="../fast/js/resources/js-test-post.js"></script> | |
| 56 </body> | |
| 57 </html> | |
| OLD | NEW |