michael@0: function test() { michael@0: waitForExplicitFinish(); michael@0: michael@0: gBrowser.selectedTab = gBrowser.addTab(); michael@0: michael@0: SpecialPowers.setIntPref("ui.tooltipDelay", 0); michael@0: michael@0: var popup = false; michael@0: var doc; michael@0: var win; michael@0: var p1; michael@0: michael@0: let onPopupShown = function(aEvent) { michael@0: popup = true; michael@0: } michael@0: michael@0: // test that a mouse click prior to the tooltip appearing blocks it michael@0: let runTest = function() { michael@0: EventUtils.synthesizeMouseAtCenter(p1, { type: "mousemove" }, win); michael@0: EventUtils.sendMouseEvent({type:'mousedown'}, p1, win); michael@0: EventUtils.sendMouseEvent({type:'mouseup'}, p1, win); michael@0: michael@0: setTimeout(function() { michael@0: is(popup, false, "shouldn't get tooltip after click"); michael@0: michael@0: document.removeEventListener("popupshown", onPopupShown, true); michael@0: SpecialPowers.clearUserPref("ui.tooltipDelay"); michael@0: michael@0: gBrowser.removeCurrentTab(); michael@0: finish(); michael@0: }, 200); michael@0: } michael@0: michael@0: let onLoad = function (aEvent) { michael@0: doc = gBrowser.contentDocument; michael@0: win = gBrowser.contentWindow; michael@0: p1 = doc.getElementById("p1"); michael@0: michael@0: document.addEventListener("popupshown", onPopupShown, true); michael@0: michael@0: runTest(); michael@0: } michael@0: michael@0: gBrowser.selectedBrowser.addEventListener("load", function loadListener() { michael@0: gBrowser.selectedBrowser.removeEventListener("load", loadListener, true); michael@0: setTimeout(onLoad, 0); michael@0: }, true); michael@0: michael@0: content.location = "data:text/html," + michael@0: "
This paragraph has a tooltip.
"; michael@0: }