Move platform/mac/accessibility tests to accessibility/mac.
[WebKit-https.git] / LayoutTests / accessibility / mac / aria-menu-closed-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="menu" role="menu">
9     <div role="menuitem" id="item1" tabindex="0">Menu item 1</div>
10     <div role="menuitem" id="item2" tabindex="0">Menu item 2</div>
11 </div>
12
13 <p id="description"></p>
14 <div id="console"></div>
15
16 <script>
17
18     description("This tests that an AXMenuClosed notification gets fired when an ARIA menu popup closes.");
19
20     function hideMenu() {
21         document.getElementById("menu").style.display = "none";
22     }
23
24     var webArea = 0;
25     function ariaCallback(notification) {
26         if (notification == "AXMenuClosed") {
27            debug("Received menu closed notification: " + notification);
28            webArea.removeNotificationListener();
29            finishJSTest();
30         }
31     }
32
33     if (window.accessibilityController) {
34         window.jsTestIsAsync = true;
35
36         webArea = accessibilityController.rootElement.childAtIndex(0);
37         var menu = accessibilityController.accessibleElementById("menu");
38
39         var addedNotification = webArea.addNotificationListener(ariaCallback);
40         shouldBe("addedNotification", "true");
41
42         hideMenu(); 
43     }
44
45 </script>
46
47 <script src="../../resources/js-test-post.js"></script>
48 </body>
49 </html>