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

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

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

mercurial