Skip to content

Commit

Permalink
Bug 1934999 - Make browser_mouseout_notification_panel.js test more r…
Browse files Browse the repository at this point in the history
…eliable; a=pascalc

By explicitly synthesizing mousemove events after the notification is shown,
instead of relying on the automatically synthesized mousemove events during reflow.

Original Revision: https://phabricator.services.mozilla.com/D231010

Differential Revision: https://phabricator.services.mozilla.com/D231363
  • Loading branch information
EdgarChen committed Dec 6, 2024
1 parent 7acb6dd commit 44a1827
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion dom/events/test/browser_mouseout_notification_panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ add_setup(async function init() {
set: [
["browser.urlbar.scotchBonnet.enableOverride", false],
["test.events.async.enabled", true],
// This test aims to synthesize mousemove events at specific times, so
// disable the automatically synthesized mousemove events during reflow.
["layout.reflow.synthMouseMove", false],
],
});

Expand All @@ -116,6 +119,7 @@ add_task(async function test_mouseout_chrome() {
info(`Showing notification should generate mouseout event on browser`);
let mouseoutPromise = waitForMouseEvent("mouseout", browser);
let { notification } = await showNotification(browser, "Test#Chrome");
synthesizeMouseAtCenter(notificationRect);
let mouseoutCoordinate = await mouseoutPromise;
info(`mouseout event: ${JSON.stringify(mouseoutCoordinate)}`);

Expand Down Expand Up @@ -143,7 +147,8 @@ add_task(async function test_mouseout_content() {
let mouseoutPromise = waitForRemoteMouseEvent("mouseout", browser);
// Ensure the event listener is registered in remote before showing notification.
await executeSoonRemote(browser);
showNotification(browser, "Test#Content");
let { notification } = await showNotification(browser, "Test#Content");
synthesizeMouseAtCenter(notificationRect);
let mouseoutCoordinate = await mouseoutPromise;
info(`remote mouseout event: ${JSON.stringify(mouseoutCoordinate)}`);

Expand All @@ -152,5 +157,7 @@ add_task(async function test_mouseout_content() {
mousemoveCoordinate,
"Test event coordinate"
);
info(`Remove notification`);
PopupNotifications.remove(notification);
});
});

0 comments on commit 44a1827

Please sign in to comment.