AX: Defer attribute computation until needed.
[WebKit-https.git] / LayoutTests / accessibility / mac / element-busy-changed.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../resources/js-test-pre.js"></script>
5 <title>Element Busy Changed</title>
6 </head>
7 <!-- Busy state begins false. -->
8 <body aria-busy="false" id="body">
9
10 <p id="description"></p>
11 <div id="console"></div>
12
13 <script>
14     description("This tests that AXElementBusyChanged is posted correctly.");
15     
16     window.jsTestIsAsync = true;
17     
18     var body = 0;
19     var notificationCount = 0;
20     
21     if (window.accessibilityController) {
22         body = accessibilityController.accessibleElementById("body");
23         body.addNotificationListener(function(notification) {
24             debug("Received " + notification + " notification " + ++notificationCount + " of 2");
25             
26             if (notificationCount == 2) {
27                 body.removeNotificationListener();
28                 
29                 finishJSTest();
30             }
31         });
32         
33         // Toggle through both busy state transitions.
34         var busyElement = document.getElementById("body");
35         busyElement.setAttribute("aria-busy", "true");
36
37         setTimeout(function() {
38             busyElement.setAttribute("aria-busy", "false");
39         }, 1);
40     }
41 </script>
42
43 <script src="../../resources/js-test-post.js"></script>
44 </body>
45 </html>