Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test gets skipped with pattern: os == 'mac' && os_version == '11.20' && arch == 'aarch64' OR os == 'mac' && os_version == '10.15' && processor == 'x86_64' OR os == 'mac' && os_version == '14.70' && processor == 'x86_64'
- Manifest: toolkit/components/pictureinpicture/tests/browser.toml
/* Any copyright is dedicated to the Public Domain.
"use strict";
Services.scriptloader.loadSubScript(
this
);
add_task(async () => {
await BrowserTestUtils.withNewTab(
{
gBrowser,
url: TEST_PAGE,
},
async browser => {
let pipWin = await triggerPictureInPicture(browser, "with-controls");
let receivedSwipeGestureEvents = false;
pipWin.addEventListener("MozSwipeGestureMayStart", () => {
receivedSwipeGestureEvents = true;
});
const wheelEventPromise = BrowserTestUtils.waitForEvent(pipWin, "wheel");
// Try swiping left to right.
await panLeftToRightBegin(pipWin, 100, 100, 100);
await panLeftToRightEnd(pipWin, 100, 100, 100);
// Wait a wheel event and a couple of frames to give a chance to receive
// the MozSwipeGestureMayStart event.
await wheelEventPromise;
await new Promise(resolve => requestAnimationFrame(resolve));
await new Promise(resolve => requestAnimationFrame(resolve));
Assert.ok(
!receivedSwipeGestureEvents,
"No swipe gesture events observed"
);
let pipClosed = BrowserTestUtils.domWindowClosed(pipWin);
pipWin.close();
await pipClosed;
}
);
});