diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:13:27 +0000 |
commit | 40a355a42d4a9444dc753c04c6608dade2f06a23 (patch) | |
tree | 871fc667d2de662f171103ce5ec067014ef85e61 /dom/base/test/fullscreen/test_fullscreen_modal.html | |
parent | Adding upstream version 124.0.1. (diff) | |
download | firefox-adbda400be353e676059e335c3c0aaf99e719475.tar.xz firefox-adbda400be353e676059e335c3c0aaf99e719475.zip |
Adding upstream version 125.0.1.upstream/125.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/base/test/fullscreen/test_fullscreen_modal.html')
-rw-r--r-- | dom/base/test/fullscreen/test_fullscreen_modal.html | 11 |
1 files changed, 10 insertions, 1 deletions
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); } |