layout/xul/test/browser_bug685470.js

Wed, 31 Dec 2014 07:16:47 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:16:47 +0100
branch
TOR_BUG_9701
changeset 3
141e0f1194b1
permissions
-rw-r--r--

Revert simplistic fix pending revisit of Mozilla integration attempt.

     1 function test() {
     2   waitForExplicitFinish();
     4   gBrowser.selectedTab = gBrowser.addTab();
     6   SpecialPowers.setIntPref("ui.tooltipDelay", 0);
     8   var popup = false;
     9   var doc;
    10   var win;
    11   var p1;
    13   let onPopupShown = function(aEvent) {
    14     popup = true;
    15   }
    17   // test that a mouse click prior to the tooltip appearing blocks it
    18   let runTest = function() {
    19     EventUtils.synthesizeMouseAtCenter(p1, { type: "mousemove" }, win);
    20     EventUtils.sendMouseEvent({type:'mousedown'}, p1, win);
    21     EventUtils.sendMouseEvent({type:'mouseup'}, p1, win);
    23     setTimeout(function() {
    24       is(popup, false, "shouldn't get tooltip after click");
    26       document.removeEventListener("popupshown", onPopupShown, true);
    27       SpecialPowers.clearUserPref("ui.tooltipDelay");
    29       gBrowser.removeCurrentTab();
    30       finish();
    31     }, 200);
    32   }
    34   let onLoad = function (aEvent) {
    35     doc = gBrowser.contentDocument;
    36     win = gBrowser.contentWindow;
    37     p1 = doc.getElementById("p1");
    39     document.addEventListener("popupshown", onPopupShown, true);
    41     runTest();
    42   }
    44   gBrowser.selectedBrowser.addEventListener("load", function loadListener() {
    45     gBrowser.selectedBrowser.removeEventListener("load", loadListener, true);
    46     setTimeout(onLoad, 0);
    47   }, true);
    49   content.location = "data:text/html," +
    50     "<p id=\"p1\" title=\"tooltip is here\">This paragraph has a tooltip.</p>";
    51 }

mercurial