2015-04-22 03:09:14 +03:00
|
|
|
add_task(async function() {
|
|
|
|
const url =
|
|
|
|
"data:text/html," +
|
|
|
|
"<html onmousemove='event.stopPropagation()'" +
|
|
|
|
" onmouseenter='event.stopPropagation()' onmouseleave='event.stopPropagation()'" +
|
|
|
|
" onmouseover='event.stopPropagation()' onmouseout='event.stopPropagation()'>" +
|
2011-11-30 16:44:53 +04:00
|
|
|
'<p id="p1" title="tooltip is here">This paragraph has a tooltip.</p>' +
|
2015-04-22 03:09:14 +03:00
|
|
|
'<p id="p2">This paragraph doesn\'t have tooltip.</p></html>';
|
|
|
|
|
|
|
|
let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, url);
|
|
|
|
let browser = gBrowser.selectedBrowser;
|
|
|
|
|
|
|
|
await new Promise(resolve => {
|
|
|
|
SpecialPowers.pushPrefEnv({ set: [["ui.tooltipDelay", 0]] }, resolve);
|
|
|
|
});
|
|
|
|
|
2015-06-05 15:33:29 +03:00
|
|
|
let popupShownPromise = BrowserTestUtils.waitForEvent(
|
|
|
|
document,
|
|
|
|
"popupshown",
|
|
|
|
false,
|
|
|
|
event => {
|
2015-04-22 03:09:14 +03:00
|
|
|
is(event.originalTarget.localName, "tooltip", "tooltip is showing");
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
);
|
2015-06-05 15:33:29 +03:00
|
|
|
let popupHiddenPromise = BrowserTestUtils.waitForEvent(
|
|
|
|
document,
|
|
|
|
"popuphidden",
|
|
|
|
false,
|
|
|
|
event => {
|
2015-04-22 03:09:14 +03:00
|
|
|
is(event.originalTarget.localName, "tooltip", "tooltip is hidden");
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
);
|
2017-12-09 00:08:44 +03:00
|
|
|
|
|
|
|
// Send a mousemove at a known position to start the test.
|
|
|
|
await BrowserTestUtils.synthesizeMouseAtCenter(
|
|
|
|
"#p2",
|
|
|
|
{ type: "mousemove" },
|
|
|
|
browser
|
|
|
|
);
|
|
|
|
await BrowserTestUtils.synthesizeMouseAtCenter(
|
|
|
|
"#p1",
|
|
|
|
{ type: "mousemove" },
|
|
|
|
browser
|
|
|
|
);
|
|
|
|
await popupShownPromise;
|
2015-04-22 03:09:14 +03:00
|
|
|
await BrowserTestUtils.synthesizeMouseAtCenter(
|
|
|
|
"#p2",
|
|
|
|
{ type: "mousemove" },
|
|
|
|
browser
|
|
|
|
);
|
|
|
|
await popupHiddenPromise;
|
|
|
|
|
|
|
|
gBrowser.removeCurrentTab();
|
|
|
|
});
|