Bug 1424074 - Register event listener earlier in browser_bug703210.js. r=Paolo

This commit is contained in:
Tooru Fujisawa 2017-12-09 06:08:44 +09:00
parent b33da27b5b
commit 58ee47803d

View File

@ -13,19 +13,19 @@ add_task(async function() {
SpecialPowers.pushPrefEnv({"set": [["ui.tooltipDelay", 0]]}, resolve);
});
// Send a mousemove at a known position to start the test.
await BrowserTestUtils.synthesizeMouseAtCenter("#p2", { type: "mousemove" }, browser);
let popupShownPromise = BrowserTestUtils.waitForEvent(document, "popupshown", false, event => {
is(event.originalTarget.localName, "tooltip", "tooltip is showing");
return true;
});
await BrowserTestUtils.synthesizeMouseAtCenter("#p1", { type: "mousemove" }, browser);
await popupShownPromise;
let popupHiddenPromise = BrowserTestUtils.waitForEvent(document, "popuphidden", false, event => {
is(event.originalTarget.localName, "tooltip", "tooltip is hidden");
return true;
});
// 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;
await BrowserTestUtils.synthesizeMouseAtCenter("#p2", { type: "mousemove" }, browser);
await popupHiddenPromise;