Move platform/mac/accessibility tests to accessibility/mac.
[WebKit-https.git] / LayoutTests / accessibility / mac / aria-liveregions-changedtext.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../../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 <h3 id="innerlive">text</h3>
10 </div>
11
12 <p id="description"></p>
13 <div id="console"></div>
14 <div id="notifications"></div>
15
16 <script>
17
18     description("This tests that when you change text in a live region, the proper notification is sent.");
19
20     var liveRegionText = 0;
21     function ariaCallbackText(notification) {
22         if (notification == "AXLiveRegionChanged") {
23            document.getElementById("notifications").innerHTML += "Successfully received " + notification;
24            liveRegionText.removeNotificationListener();
25            window.testRunner.notifyDone();
26         }
27     }
28
29     if (window.accessibilityController) {
30         window.testRunner.waitUntilDone();
31
32         document.getElementById("liveregion").focus();
33         liveRegionText = window.accessibilityController.focusedElement;
34
35         var addedNotification = liveRegionText.addNotificationListener(ariaCallbackText);
36         shouldBe("addedNotification", "true");
37
38         // this should trigger our live region callback for a text change.
39         document.getElementById("innerlive").innerText = "changed text";
40     }
41
42 </script>
43
44 <script src="../../resources/js-test-post.js"></script>
45 </body>
46 </html>