summaryrefslogtreecommitdiffstats
path: root/toolkit/components/pictureinpicture/tests
diff options
context:
space:
mode:
Diffstat (limited to 'toolkit/components/pictureinpicture/tests')
-rw-r--r--toolkit/components/pictureinpicture/tests/browser_cannotTriggerFromContent.js2
-rw-r--r--toolkit/components/pictureinpicture/tests/browser_closePip_pageNavigationChanges.js4
-rw-r--r--toolkit/components/pictureinpicture/tests/browser_preserveTabPipIconOverlay.js4
-rw-r--r--toolkit/components/pictureinpicture/tests/browser_removeVideoElement.js2
-rw-r--r--toolkit/components/pictureinpicture/tests/browser_reversePiP.js25
-rw-r--r--toolkit/components/pictureinpicture/tests/browser_touch_toggle_enablepip.js2
6 files changed, 27 insertions, 12 deletions
diff --git a/toolkit/components/pictureinpicture/tests/browser_cannotTriggerFromContent.js b/toolkit/components/pictureinpicture/tests/browser_cannotTriggerFromContent.js
index 4c3d32b474..1ba93dbb8c 100644
--- a/toolkit/components/pictureinpicture/tests/browser_cannotTriggerFromContent.js
+++ b/toolkit/components/pictureinpicture/tests/browser_cannotTriggerFromContent.js
@@ -18,7 +18,7 @@ add_task(async () => {
// if we receive the PictureInPicture:Request message.
const MESSAGE = "PictureInPicture:Request";
let sawMessage = false;
- let listener = msg => {
+ let listener = () => {
sawMessage = true;
};
browser.messageManager.addMessageListener(MESSAGE, listener);
diff --git a/toolkit/components/pictureinpicture/tests/browser_closePip_pageNavigationChanges.js b/toolkit/components/pictureinpicture/tests/browser_closePip_pageNavigationChanges.js
index c64b5f2b14..b4615c42a1 100644
--- a/toolkit/components/pictureinpicture/tests/browser_closePip_pageNavigationChanges.js
+++ b/toolkit/components/pictureinpicture/tests/browser_closePip_pageNavigationChanges.js
@@ -65,7 +65,7 @@ add_task(async function test_close_pagehide() {
ok(pipWin, "Got Picture-in-Picture window.");
let pipClosed = BrowserTestUtils.domWindowClosed(pipWin);
- await SpecialPowers.spawn(browser, [{ videoID }], async args => {
+ await SpecialPowers.spawn(browser, [{ videoID }], async () => {
content.location.href = "otherpage.html";
});
@@ -92,7 +92,7 @@ add_task(async function test_open_pip_window_history_nav() {
let pipWin = await triggerPictureInPicture(browser, videoID);
ok(pipWin, "Got Picture-in-Picture window.");
- await SpecialPowers.spawn(browser, [{ videoID }], async args => {
+ await SpecialPowers.spawn(browser, [{ videoID }], async () => {
let popStatePromise = ContentTaskUtils.waitForEvent(
content,
"popstate"
diff --git a/toolkit/components/pictureinpicture/tests/browser_preserveTabPipIconOverlay.js b/toolkit/components/pictureinpicture/tests/browser_preserveTabPipIconOverlay.js
index 55cd003a2c..b1296607f1 100644
--- a/toolkit/components/pictureinpicture/tests/browser_preserveTabPipIconOverlay.js
+++ b/toolkit/components/pictureinpicture/tests/browser_preserveTabPipIconOverlay.js
@@ -12,8 +12,8 @@ var EventUtils = {};
Services.scriptloader.loadSubScript(EVENTUTILS_URL, EventUtils);
async function detachTab(tab) {
- let newWindowPromise = new Promise((resolve, reject) => {
- let observe = (win, topic, data) => {
+ let newWindowPromise = new Promise(resolve => {
+ let observe = win => {
Services.obs.removeObserver(observe, "domwindowopened");
resolve(win);
};
diff --git a/toolkit/components/pictureinpicture/tests/browser_removeVideoElement.js b/toolkit/components/pictureinpicture/tests/browser_removeVideoElement.js
index d9622dc3f0..ece635fd34 100644
--- a/toolkit/components/pictureinpicture/tests/browser_removeVideoElement.js
+++ b/toolkit/components/pictureinpicture/tests/browser_removeVideoElement.js
@@ -28,7 +28,7 @@ add_task(async () => {
let otherVideo = doc.querySelector(`video:not([id="${videoID}"])`);
let eventFired = false;
- let listener = e => {
+ let listener = () => {
eventFired = true;
};
diff --git a/toolkit/components/pictureinpicture/tests/browser_reversePiP.js b/toolkit/components/pictureinpicture/tests/browser_reversePiP.js
index a8ae20166f..3f8b43b02b 100644
--- a/toolkit/components/pictureinpicture/tests/browser_reversePiP.js
+++ b/toolkit/components/pictureinpicture/tests/browser_reversePiP.js
@@ -53,8 +53,11 @@ add_task(async () => {
}
);
- // The "flipped" attribute should be set on the toggle button (when applicable).
- Assert.equal(toggleFlippedAttribute, "true");
+ Assert.equal(
+ toggleFlippedAttribute,
+ "",
+ `The "flipped" attribute should be set on the toggle button (when applicable).`
+ );
}
);
});
@@ -110,12 +113,20 @@ add_task(async () => {
let videoID = "reversed";
let videoFlippedAttribute = await getFlippedAttribute(browser, videoID);
- Assert.equal(videoFlippedAttribute, null); // The "flipped" attribute should not be set initially.
+ Assert.equal(
+ videoFlippedAttribute,
+ null,
+ `The "flipped" attribute should not be set initially.`
+ );
let pipWin = await triggerPictureInPicture(browser, videoID);
videoFlippedAttribute = await getFlippedAttribute(browser, "reversed");
- Assert.equal(videoFlippedAttribute, "true"); // The "flipped" value should be set once the PiP window is opened (when applicable).
+ Assert.equal(
+ videoFlippedAttribute,
+ "true",
+ `The "flipped" value should be set once the PiP window is opened (when applicable).`
+ );
let playerBrowser = pipWin.document.getElementById("browser");
let pipVideoTransform = await getPiPVideoTransform(playerBrowser);
@@ -124,7 +135,11 @@ add_task(async () => {
await ensureMessageAndClosePiP(browser, videoID, pipWin, false);
videoFlippedAttribute = await getFlippedAttribute(browser, "reversed");
- Assert.equal(videoFlippedAttribute, null); // The "flipped" attribute should be removed after closing PiP.
+ Assert.equal(
+ videoFlippedAttribute,
+ null,
+ `The "flipped" attribute should be removed after closing PiP.`
+ );
// Now we want to test that regular (not-reversed) videos are unaffected
videoID = "not-reversed";
diff --git a/toolkit/components/pictureinpicture/tests/browser_touch_toggle_enablepip.js b/toolkit/components/pictureinpicture/tests/browser_touch_toggle_enablepip.js
index e50c430d0c..46eebe1719 100644
--- a/toolkit/components/pictureinpicture/tests/browser_touch_toggle_enablepip.js
+++ b/toolkit/components/pictureinpicture/tests/browser_touch_toggle_enablepip.js
@@ -30,7 +30,7 @@ add_task(async () => {
// Remove other page elements before reading PiP toggle's client rect.
// Otherwise, we will provide the wrong coordinates when simulating the touch event.
- await SpecialPowers.spawn(browser, [], async args => {
+ await SpecialPowers.spawn(browser, [], async () => {
info(
"Removing other elements first to make the PiP toggle more visible"
);