diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:29 +0000 |
commit | 59203c63bb777a3bacec32fb8830fba33540e809 (patch) | |
tree | 58298e711c0ff0575818c30485b44a2f21bf28a0 /testing/web-platform/tests/screen-wake-lock | |
parent | Adding upstream version 126.0.1. (diff) | |
download | firefox-59203c63bb777a3bacec32fb8830fba33540e809.tar.xz firefox-59203c63bb777a3bacec32fb8830fba33540e809.zip |
Adding upstream version 127.0.upstream/127.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/screen-wake-lock')
-rw-r--r-- | testing/web-platform/tests/screen-wake-lock/wakelock-active-document.https.window.js | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/testing/web-platform/tests/screen-wake-lock/wakelock-active-document.https.window.js b/testing/web-platform/tests/screen-wake-lock/wakelock-active-document.https.window.js index 724ce09196..6de27d49ef 100644 --- a/testing/web-platform/tests/screen-wake-lock/wakelock-active-document.https.window.js +++ b/testing/web-platform/tests/screen-wake-lock/wakelock-active-document.https.window.js @@ -38,7 +38,26 @@ promise_test(async t => { ); // We are done, so clean up. iframe.remove(); -}, "navigator.wakeLock.request() aborts if the document is not active."); +}, "navigator.wakeLock.request() aborts if the document becomes not active."); + +promise_test(async t => { + const iframe = document.createElement("iframe"); + document.body.appendChild(iframe); + const wakeLock = await getWakeLockObject( + iframe, + "/screen-wake-lock/resources/page1.html" + ); + // Save the DOMException of page1.html before navigating away. + const frameDOMException = iframe.contentWindow.DOMException; + iframe.remove(); + await promise_rejects_dom( + t, + "NotAllowedError", + frameDOMException, + wakeLock.request('screen'), + "Inactive document, so must throw NotAllowedError" + ); +}, "navigator.wakeLock.request() aborts if the document is not fully active."); promise_test(async t => { // We nest two iframes and wait for them to load. |