Commit 58ee4780 authored by Tooru Fujisawa's avatar Tooru Fujisawa
Browse files

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

parent b33da27b
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -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;