REGRESSION(r184899): Crash when focusing an input element styled with a web font
[WebKit-https.git] / LayoutTests / platform / mac / accessibility / expanded-notification.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 id="content">
9
10 <button id="button" aria-expanded="false">
11
12 </div>
13
14 <p id="description"></p>
15 <div id="console"></div>
16
17 <script>
18
19     description("This tests that aria-expanded changes will send notifications.");
20
21     var element = 0;
22     var notification = 0;
23     var notificationCount = 0;
24     function ariaCallback(element, notification) {
25         if (notification == "AXExpandedChanged") {
26            notificationCount++;
27
28            debug("Received notification: " + notification);
29            debug("Expanded status: " + element.isExpanded);
30            if (notificationCount == 2) {
31                accessibilityController.removeNotificationListener();
32                finishJSTest();
33            }
34         }
35     }
36
37     if (window.accessibilityController) {
38         window.jsTestIsAsync = true;
39
40         var addedNotification = accessibilityController.addNotificationListener(ariaCallback);
41         debug("Initial expanded status: " + accessibilityController.accessibleElementById("button").isExpanded);
42
43         setTimeout(function() {
44             document.getElementById("button").setAttribute("aria-expanded", "true");
45             setTimeout(function() {
46                 document.getElementById("button").setAttribute("aria-expanded", "false");
47             }, 10);
48         }, 10);
49     }
50
51 </script>
52
53 <script src="../../../resources/js-test-post.js"></script>
54 </body>
55 </html>