michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: * http://creativecommons.org/publicdomain/zero/1.0/ michael@0: */ michael@0: michael@0: function test () { michael@0: waitForExplicitFinish(); michael@0: window.maximize(); michael@0: michael@0: // Find where the nav-bar is vertically. michael@0: var navBar = document.getElementById("nav-bar"); michael@0: var boundingRect = navBar.getBoundingClientRect(); michael@0: var yPixel = boundingRect.top + Math.floor(boundingRect.height / 2); michael@0: var xPixel = boundingRect.width - 1; // Use the last pixel of the screen since it is maximized. michael@0: michael@0: function onPopupHidden() { michael@0: PanelUI.panel.removeEventListener("popuphidden", onPopupHidden); michael@0: window.restore(); michael@0: finish(); michael@0: } michael@0: function onPopupShown() { michael@0: PanelUI.panel.removeEventListener("popupshown", onPopupShown); michael@0: ok(true, "Clicking at the far edge of the window opened the menu popup."); michael@0: PanelUI.panel.addEventListener("popuphidden", onPopupHidden); michael@0: PanelUI.hide(); michael@0: } michael@0: registerCleanupFunction(function() { michael@0: PanelUI.panel.removeEventListener("popupshown", onPopupShown); michael@0: PanelUI.panel.removeEventListener("popuphidden", onPopupHidden); michael@0: }); michael@0: PanelUI.panel.addEventListener("popupshown", onPopupShown); michael@0: EventUtils.synthesizeMouseAtPoint(xPixel, yPixel, {}, window); michael@0: }