diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:33 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:33 +0000 |
commit | 086c044dc34dfc0f74fbe41f4ecb402b2cd34884 (patch) | |
tree | a4f824bd33cb075dd5aa3eb5a0a94af221bbe83a /dom/base/test/fullscreen | |
parent | Adding debian version 124.0.1-1. (diff) | |
download | firefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.tar.xz firefox-086c044dc34dfc0f74fbe41f4ecb402b2cd34884.zip |
Merging upstream version 125.0.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/base/test/fullscreen')
15 files changed, 36 insertions, 27 deletions
diff --git a/dom/base/test/fullscreen/MozDomFullscreen_chrome.xhtml b/dom/base/test/fullscreen/MozDomFullscreen_chrome.xhtml index 93f00311e7..bc92abf3e0 100644 --- a/dom/base/test/fullscreen/MozDomFullscreen_chrome.xhtml +++ b/dom/base/test/fullscreen/MozDomFullscreen_chrome.xhtml @@ -79,7 +79,7 @@ function thirdEntry(event) { gOuterDoc.exitFullscreen(); } -function earlyExit(event) { +function earlyExit() { ok(false, "MozDOMFullscreen:Exited should only be triggered after cancel all fullscreen"); } diff --git a/dom/base/test/fullscreen/browser_fullscreen-navigation-history-race.js b/dom/base/test/fullscreen/browser_fullscreen-navigation-history-race.js index 2ea2b9ee40..49a48c3177 100644 --- a/dom/base/test/fullscreen/browser_fullscreen-navigation-history-race.js +++ b/dom/base/test/fullscreen/browser_fullscreen-navigation-history-race.js @@ -82,7 +82,7 @@ function preventBFCache(aBrowsingContext, aPrevent) { let target = content.document.getElementById("div"); target.addEventListener( "mousedown", - function (e) { + function () { content.window.history.back(); }, { once: true } diff --git a/dom/base/test/fullscreen/browser_fullscreen-tab-close-race.js b/dom/base/test/fullscreen/browser_fullscreen-tab-close-race.js index 10d10a0b0f..1338c4a550 100644 --- a/dom/base/test/fullscreen/browser_fullscreen-tab-close-race.js +++ b/dom/base/test/fullscreen/browser_fullscreen-tab-close-race.js @@ -70,7 +70,7 @@ async function WaitRemoveDocumentAndCloseTab(aBrowser, aBrowsingContext) { return new Promise(resolve => { content.document.addEventListener( "fullscreenchange", - e => { + () => { resolve(); }, { once: true } diff --git a/dom/base/test/fullscreen/file_fullscreen-api.html b/dom/base/test/fullscreen/file_fullscreen-api.html index 645e6ece46..9661b10de9 100644 --- a/dom/base/test/fullscreen/file_fullscreen-api.html +++ b/dom/base/test/fullscreen/file_fullscreen-api.html @@ -112,7 +112,7 @@ function enter2(event) { promise = document.exitFullscreen(); } -function exit2(event) { +function exit2() { is(document.fullscreenElement, null, "Full-screen element should have rolled back."); is(iframe.contentDocument.fullscreenElement, null, @@ -156,7 +156,7 @@ function exit3(event) { promise = outOfDocElement.requestFullscreen(); } -function error1(event) { +function error1() { ok(!document.fullscreenElement, "Requests for full-screen from not-in-doc elements should fail."); assertPromiseRejected(promise, "in error1"); @@ -181,7 +181,7 @@ function enter4(event) { "Should not have a full-screen element again."); } -async function exit_to_arg_test_1(event) { +async function exit_to_arg_test_1() { ok(!document.fullscreenElement, "Should have left full-screen mode (third time)."); addFullscreenChangeContinuation("enter", enter_from_arg_test_1); @@ -196,14 +196,14 @@ async function exit_to_arg_test_1(event) { ok(!threw, "requestFullscreen with bogus arg (123) shouldn't throw exception"); } -function enter_from_arg_test_1(event) { +function enter_from_arg_test_1() { ok(document.fullscreenElement, "Should have entered full-screen after calling with bogus (ignored) argument (fourth time)"); addFullscreenChangeContinuation("exit", exit_to_arg_test_2); document.exitFullscreen(); } -async function exit_to_arg_test_2(event) { +async function exit_to_arg_test_2() { ok(!document.fullscreenElement, "Should have left full-screen mode (fourth time)."); addFullscreenChangeContinuation("enter", enter_from_arg_test_2); @@ -218,14 +218,14 @@ async function exit_to_arg_test_2(event) { ok(!threw, "requestFullscreen with { vrDisplay: null } shouldn't throw exception"); } -function enter_from_arg_test_2(event) { +function enter_from_arg_test_2() { ok(document.fullscreenElement, "Should have entered full-screen after calling with vrDisplay null argument (fifth time)"); addFullscreenChangeContinuation("exit", exit4); document.exitFullscreen(); } -function exit4(event) { +function exit4() { ok(!document.fullscreenElement, "Should be back in non-full-screen mode (fifth time)"); SpecialPowers.pushPrefEnv({"set":[["full-screen-api.allow-trusted-requests-only", true]]}, function() { @@ -234,7 +234,7 @@ function exit4(event) { }); } -function error2(event) { +function error2() { ok(!document.fullscreenElement, "Should still be in normal mode, because calling context isn't trusted."); button = document.createElement("button"); @@ -246,13 +246,13 @@ function error2(event) { sendMouseClick(button); } -function enter5(event) { +function enter5() { ok(document.fullscreenElement, "Moved to full-screen after mouse click"); addFullscreenChangeContinuation("exit", exit5); document.exitFullscreen(); } -function exit5(event) { +function exit5() { ok(!document.fullscreenElement, "Should have left full-screen mode (last time)."); SpecialPowers.pushPrefEnv({ @@ -264,7 +264,7 @@ function exit5(event) { }); } -function error3(event) { +function error3() { ok(!document.fullscreenElement, "Should still be in normal mode, because pref is not enabled."); diff --git a/dom/base/test/fullscreen/file_fullscreen-bug-1798219-2.html b/dom/base/test/fullscreen/file_fullscreen-bug-1798219-2.html index 61db80c228..48f2dea09d 100644 --- a/dom/base/test/fullscreen/file_fullscreen-bug-1798219-2.html +++ b/dom/base/test/fullscreen/file_fullscreen-bug-1798219-2.html @@ -2,7 +2,7 @@ <button>Launch</button> <script> let button = document.querySelector("button"); -button.addEventListener("click", function(e) { +button.addEventListener("click", function() { let newWindow = window.open("", "", "newWindow"); newWindow.document.write(`<!DOCTYPE HTML> <button>click me!</button> diff --git a/dom/base/test/fullscreen/file_fullscreen-bug-1798219.html b/dom/base/test/fullscreen/file_fullscreen-bug-1798219.html index 7490f12936..beafd79661 100644 --- a/dom/base/test/fullscreen/file_fullscreen-bug-1798219.html +++ b/dom/base/test/fullscreen/file_fullscreen-bug-1798219.html @@ -2,7 +2,7 @@ <button>click me!</button> <script> let button = document.querySelector("button"); -button.addEventListener("click", function(e) { +button.addEventListener("click", function() { document.documentElement.requestFullscreen(); setTimeout(() => { while(true) { diff --git a/dom/base/test/fullscreen/file_fullscreen-denied.html b/dom/base/test/fullscreen/file_fullscreen-denied.html index db9a69e71a..fe4244ec7f 100644 --- a/dom/base/test/fullscreen/file_fullscreen-denied.html +++ b/dom/base/test/fullscreen/file_fullscreen-denied.html @@ -137,7 +137,7 @@ function requestFullscreenMouseBtn(event, button) { synthesizeMouseAtCenter(clickEl, { button }); } -async function testFullscreenMouseBtn(event, button, next) { +async function testFullscreenMouseBtn() { await SpecialPowers.pushPrefEnv({ "set": [["full-screen-api.mouse-event-allow-left-button-only", true]] }); diff --git a/dom/base/test/fullscreen/file_fullscreen-esc-exit-inner.html b/dom/base/test/fullscreen/file_fullscreen-esc-exit-inner.html index d7d8a90aaf..210b2af1b6 100644 --- a/dom/base/test/fullscreen/file_fullscreen-esc-exit-inner.html +++ b/dom/base/test/fullscreen/file_fullscreen-esc-exit-inner.html @@ -33,7 +33,7 @@ function is(a, b, msg) { var escKeyReceived = false; var escKeySent = false; -function keyHandler(event) { +function keyHandler() { if (escKeyReceived == KeyboardEvent.DOM_VK_ESC) { escKeyReceived = true; } diff --git a/dom/base/test/fullscreen/file_fullscreen-esc-exit.html b/dom/base/test/fullscreen/file_fullscreen-esc-exit.html index f65f930b3f..1e2252f1ab 100644 --- a/dom/base/test/fullscreen/file_fullscreen-esc-exit.html +++ b/dom/base/test/fullscreen/file_fullscreen-esc-exit.html @@ -34,14 +34,14 @@ function finish() { opener.nextTest(); } -function fullscreenchange1(event) { +function fullscreenchange1() { is(document.fullscreenElement, document.body, "FSE should be doc"); addFullscreenChangeContinuation("exit", fullscreenchange2); ok(!document.getElementById("subdoc").contentWindow.escKeySent, "Should not yet have sent ESC key press."); document.getElementById("subdoc").contentWindow.startTest(); } -function fullscreenchange2(event) { +function fullscreenchange2() { ok(document.getElementById("subdoc").contentWindow.escKeySent, "Should have sent ESC key press."); ok(!document.getElementById("subdoc").contentWindow.escKeyReceived, "ESC key press to exit should not be delivered."); ok(!document.fullscreenElement, "Should have left full-screen mode on ESC key press"); diff --git a/dom/base/test/fullscreen/file_fullscreen-shadowdom.html b/dom/base/test/fullscreen/file_fullscreen-shadowdom.html index 348e08ae87..1972e1457e 100644 --- a/dom/base/test/fullscreen/file_fullscreen-shadowdom.html +++ b/dom/base/test/fullscreen/file_fullscreen-shadowdom.html @@ -29,7 +29,7 @@ var elem = shadowRoot.firstChild; var gotFullscreenEvent = false; - document.addEventListener("fullscreenchange", function (e) { + document.addEventListener("fullscreenchange", function () { if (document.fullscreenElement === host) { is(shadowRoot.fullscreenElement, elem, "Expected element entered fullsceen"); diff --git a/dom/base/test/fullscreen/file_fullscreen-svg-element.html b/dom/base/test/fullscreen/file_fullscreen-svg-element.html index 1dfc78aa1c..d03a13ee84 100644 --- a/dom/base/test/fullscreen/file_fullscreen-svg-element.html +++ b/dom/base/test/fullscreen/file_fullscreen-svg-element.html @@ -32,7 +32,7 @@ var elem = document.getElementById("svg-elem") , elemWasLocked = false; - document.addEventListener("fullscreenchange", function (e) { + document.addEventListener("fullscreenchange", function () { if (document.fullscreenElement === elem) { elemWasLocked = true; document.exitFullscreen(); diff --git a/dom/base/test/fullscreen/fullscreen.xhtml b/dom/base/test/fullscreen/fullscreen.xhtml index 2cc95642b6..76986db540 100644 --- a/dom/base/test/fullscreen/fullscreen.xhtml +++ b/dom/base/test/fullscreen/fullscreen.xhtml @@ -11,7 +11,7 @@ window.addEventListener("fullscreen", onFullScreen, true); -function onFullScreen(event) +function onFullScreen() { window.arguments[0].done(window.fullScreen); } diff --git a/dom/base/test/fullscreen/fullscreen_helpers.js b/dom/base/test/fullscreen/fullscreen_helpers.js index 6e78015cd8..f097ae316e 100644 --- a/dom/base/test/fullscreen/fullscreen_helpers.js +++ b/dom/base/test/fullscreen/fullscreen_helpers.js @@ -83,7 +83,7 @@ function waitWidgetFullscreenEvent( aIsInFullscreen, aWaitUntil = false ) { - return BrowserTestUtils.waitForEvent(aWindow, "fullscreen", false, aEvent => { + return BrowserTestUtils.waitForEvent(aWindow, "fullscreen", false, () => { if ( aWaitUntil && aIsInFullscreen != @@ -106,7 +106,7 @@ function waitForFullScreenObserver( aIsInFullscreen, aWaitUntil = false ) { - return TestUtils.topicObserved("fullscreen-painted", (subject, data) => { + return TestUtils.topicObserved("fullscreen-painted", () => { if ( aWaitUntil && aIsInFullscreen != diff --git a/dom/base/test/fullscreen/test_fullscreen-api.html b/dom/base/test/fullscreen/test_fullscreen-api.html index 2a59d6eeb0..ef07a5f97f 100644 --- a/dom/base/test/fullscreen/test_fullscreen-api.html +++ b/dom/base/test/fullscreen/test_fullscreen-api.html @@ -111,7 +111,7 @@ function runNextTest() { // otherwise, the fullscreen request might be denied. if (testWindow.document.hidden) { info("Waiting for document to unhide"); - waitForEvent(testWindow.document, "visibilitychange", (event) => { + waitForEvent(testWindow.document, "visibilitychange", () => { return !testWindow.document.hidden; }, testWindow.begin); return; diff --git a/dom/base/test/fullscreen/test_fullscreen_modal.html b/dom/base/test/fullscreen/test_fullscreen_modal.html index 78e70d9052..fef4e3867d 100644 --- a/dom/base/test/fullscreen/test_fullscreen_modal.html +++ b/dom/base/test/fullscreen/test_fullscreen_modal.html @@ -21,7 +21,7 @@ const button = document.querySelector("button"); let clickCount = 0; let lastFullscreenPromise = null; let shouldEnterFullscreen = false; -button.addEventListener("click", function(e) { +button.addEventListener("click", function() { clickCount++; if (shouldEnterFullscreen) { const fullscreenElement = document.getElementById("fullscreen"); @@ -58,6 +58,15 @@ async function testFullscreenIsModal(modal) { ok(document.fullscreenElement.matches(":fullscreen"), "Fullscreen element matches :fullscreen"); is(document.fullscreenElement.matches(":modal"), modal, "Fullscreen element matches :modal"); + // Before exiting fullscreen, wait on the document becoming active, + // which signifies that the fullscreen request has been completely + // processed. It is important that the fullscreen request is all + // the way done, or the exit fullscreen request could be dropped. + let documentWrapper = SpecialPowers.wrap(document); + await SimpleTest.promiseWaitForCondition(() => documentWrapper.isActive(), + "Timed out waiting for document to become active."); + ok(documentWrapper.isActive(), "Document is active."); + await document.exitFullscreen(); clickButton(/* expectEvent = */ true); } |