await SpecialPowers.pushPrefEnv({
set: [
["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],
],
});
info(`Show notification to get its size and position`);
let { notification, rect } = await showNotification(
gBrowser.selectedBrowser, "Test#Init"
);
PopupNotifications.remove(notification);
notificationRect = rect;
});
add_task(async function test_mouseout_chrome() {
await BrowserTestUtils.withNewTab("about:blank", async browser => {
info(`Generate mousemove event on browser`);
let mousemovePromise = waitForMouseEvent("mousemove", browser);
synthesizeMouseAtCenter(notificationRect);
let mousemoveCoordinate = await mousemovePromise;
info(`mousemove event: ${JSON.stringify(mousemoveCoordinate)}`);
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)}`);
add_task(async function test_mouseout_content() {
await BrowserTestUtils.withNewTab("about:blank", async browser => {
info(`Generate mousemove event on content`);
let mousemovePromise = waitForRemoteMouseEvent("mousemove", browser); // Ensure the event listener is registered in remote before synthesizing mouse event.
await executeSoonRemote(browser);
synthesizeMouseAtCenter(notificationRect);
let mousemoveCoordinate = await mousemovePromise;
info(`mousemove event on content: ${JSON.stringify(mousemoveCoordinate)}`);
info(`Showing notification should generate mouseout event on content`);
let mouseoutPromise = waitForRemoteMouseEvent("mouseout", browser); // Ensure the event listener is registered in remote before showing notification.
await executeSoonRemote(browser);
let { notification } = await showNotification(browser, "Test#Content");
synthesizeMouseAtCenter(notificationRect);
let mouseoutCoordinate = await mouseoutPromise;
info(`remote mouseout event: ${JSON.stringify(mouseoutCoordinate)}`);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.