add_task(function* () { const url = "data:text/html," + "" + "
This paragraph has a tooltip.
" + "This paragraph doesn't have tooltip.
"; let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, url); let browser = gBrowser.selectedBrowser; yield new Promise(resolve => { SpecialPowers.pushPrefEnv({"set": [["ui.tooltipDelay", 0]]}, resolve); }); // Send a mousemove at a known position to start the test. yield BrowserTestUtils.synthesizeMouseAtCenter("#p2", { type: "mousemove" }, browser); let popupShownPromise = BrowserTestUtils.waitForEvent(document, "popupshown", false, event => { is(event.originalTarget.localName, "tooltip", "tooltip is showing"); return true; }); yield BrowserTestUtils.synthesizeMouseAtCenter("#p1", { type: "mousemove" }, browser); yield popupShownPromise; let popupHiddenPromise = BrowserTestUtils.waitForEvent(document, "popuphidden", false, event => { is(event.originalTarget.localName, "tooltip", "tooltip is hidden"); return true; }); yield BrowserTestUtils.synthesizeMouseAtCenter("#p2", { type: "mousemove" }, browser); yield popupHiddenPromise; gBrowser.removeCurrentTab(); });