blob: 58d865c7883e3c4e79f59a15f28e7b5f9864dbff [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<script src="../../resources/js-test-pre.js"></script>
</head>
<body id="body">
<div id="menu" role="menu">
<div role="menuitem" id="item1" tabindex="0">Menu item 1</div>
<div role="menuitem" id="item2" tabindex="0">Menu item 2</div>
</div>
<p id="description"></p>
<div id="console"></div>
<script>
description("This tests that an AXMenuClosed notification gets fired when an ARIA menu popup closes.");
function hideMenu() {
document.getElementById("menu").style.display = "none";
}
var webArea = 0;
function ariaCallback(notification) {
if (notification == "AXMenuClosed") {
debug("Received menu closed notification: " + notification);
webArea.removeNotificationListener();
finishJSTest();
}
}
if (window.accessibilityController) {
window.jsTestIsAsync = true;
webArea = accessibilityController.rootElement.childAtIndex(0);
var menu = accessibilityController.accessibleElementById("menu");
var addedNotification = webArea.addNotificationListener(ariaCallback);
shouldBe("addedNotification", "true");
hideMenu();
}
</script>
<script src="../../resources/js-test-post.js"></script>
</body>
</html>