REGRESSION(r184899): Crash when focusing an input element styled with a web font
[WebKit-https.git] / LayoutTests / accessibility / mac / aria-liveregions-notifications-always-sent.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="liveregion1" aria-live="polite" aria-relevant="additions">
9 Test
10 </div>
11 <div role="group" tabindex=0 id="liveregion2" aria-live="polite" aria-relevant="additions"></div>
12
13 <p id="description"></p>
14 <div id="console"></div>
15
16 <script>
17     var jsTestIsAsync = true;
18
19     description("This tests that ARIA live region notifications are sent even when an assistive technology is not accessing them directly on each update.");
20
21     if (window.accessibilityController) {
22
23         var liveRegion1 = accessibilityController.accessibleElementById("liveregion1");
24         var liveRegion2 = accessibilityController.accessibleElementById("liveregion2");
25
26         var liveRegion1Changed = false;
27         var liveRegion2Changed = false;
28         function ariaCallback1(notification) {
29            if (notification == "AXLiveRegionChanged") {
30                liveRegion1Changed = true;
31                finishTest();
32            }
33         }
34         function ariaCallback2(notification) {
35            if (notification == "AXLiveRegionChanged") {
36                liveRegion2Changed = true;
37                finishTest();
38            }
39         }
40
41         addedNotification1 = liveRegion1.addNotificationListener(ariaCallback1);
42         shouldBe("addedNotification1", "true");
43         addedNotification2 = liveRegion2.addNotificationListener(ariaCallback2);
44         shouldBe("addedNotification2", "true");
45
46         // this should trigger our live region callback for a new element.
47         for (var k = 1; k < 3; k++) {
48             var textNode = document.createTextNode("test" + k);
49             document.getElementById("liveregion" + k).appendChild(textNode);
50         }
51     }
52
53     function finishTest() {
54         // We should get a total of two live region changes.
55         if (liveRegion1Changed && liveRegion2Changed) {
56             liveRegion1.removeNotificationListener();
57             liveRegion2.removeNotificationListener();
58             finishJSTest();
59         }        
60     }
61
62 </script>
63
64 <script src="../../resources/js-test-post.js"></script>
65 </body>
66 </html>