browser/base/content/test/general/browser_menuButtonFitts.js

Thu, 15 Jan 2015 15:55:04 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:55:04 +0100
branch
TOR_BUG_9701
changeset 9
a63d609f5ebe
permissions
-rw-r--r--

Back out 97036ab72558 which inappropriately compared turds to third parties.

michael@0 1 /* Any copyright is dedicated to the Public Domain.
michael@0 2 * http://creativecommons.org/publicdomain/zero/1.0/
michael@0 3 */
michael@0 4
michael@0 5 function test () {
michael@0 6 waitForExplicitFinish();
michael@0 7 window.maximize();
michael@0 8
michael@0 9 // Find where the nav-bar is vertically.
michael@0 10 var navBar = document.getElementById("nav-bar");
michael@0 11 var boundingRect = navBar.getBoundingClientRect();
michael@0 12 var yPixel = boundingRect.top + Math.floor(boundingRect.height / 2);
michael@0 13 var xPixel = boundingRect.width - 1; // Use the last pixel of the screen since it is maximized.
michael@0 14
michael@0 15 function onPopupHidden() {
michael@0 16 PanelUI.panel.removeEventListener("popuphidden", onPopupHidden);
michael@0 17 window.restore();
michael@0 18 finish();
michael@0 19 }
michael@0 20 function onPopupShown() {
michael@0 21 PanelUI.panel.removeEventListener("popupshown", onPopupShown);
michael@0 22 ok(true, "Clicking at the far edge of the window opened the menu popup.");
michael@0 23 PanelUI.panel.addEventListener("popuphidden", onPopupHidden);
michael@0 24 PanelUI.hide();
michael@0 25 }
michael@0 26 registerCleanupFunction(function() {
michael@0 27 PanelUI.panel.removeEventListener("popupshown", onPopupShown);
michael@0 28 PanelUI.panel.removeEventListener("popuphidden", onPopupHidden);
michael@0 29 });
michael@0 30 PanelUI.panel.addEventListener("popupshown", onPopupShown);
michael@0 31 EventUtils.synthesizeMouseAtPoint(xPixel, yPixel, {}, window);
michael@0 32 }

mercurial