JS Test Harness: Remove successfullyParsed from more tests
[WebKit-https.git] / LayoutTests / platform / mac / accessibility / aria-liveregions-changedalt.html
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 <div role="group" tabindex=0 id="liveregion" aria-live="polite" aria-relevant="additions">
9 <img src="test.gif" width=100 height=100 alt="alt text" id="image">
10 </div>
11
12 <p id="description"></p>
13 <div id="console"></div>
14
15 <script>
16
17     description("This tests that changing the alt tag of an image in a live region triggers a live region notification.");
18
19     var liveRegionAlt = 0;
20     function ariaCallbackAlt(notification) {
21         if (notification == "AXLiveRegionChanged") {
22            alert("Successfully received " + notification);
23            liveRegionAlt.removeNotificationListener();
24            window.layoutTestController.notifyDone();
25         }
26     }
27
28     if (window.accessibilityController) {
29         window.layoutTestController.waitUntilDone();
30
31         document.getElementById("liveregion").focus();
32         liveRegionAlt = window.accessibilityController.focusedElement;
33
34         var addedNotification = liveRegionAlt.addNotificationListener(ariaCallbackAlt);
35         shouldBe("addedNotification", "true");
36
37         // this should also trigger our live region change because its a text alternative change. 
38         document.getElementById("image").setAttribute('alt', "new image text");
39     }
40
41 </script>
42
43 <script src="../../../fast/js/resources/js-test-post.js"></script>
44 </body>
45 </html>