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