diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:47:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:47:29 +0000 |
commit | 0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d (patch) | |
tree | a31f07c9bcca9d56ce61e9a1ffd30ef350d513aa /testing/web-platform/tests/screen-wake-lock/chrome-bug-1348019.https.html | |
parent | Initial commit. (diff) | |
download | firefox-esr-0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d.tar.xz firefox-esr-0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d.zip |
Adding upstream version 115.8.0esr.upstream/115.8.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/screen-wake-lock/chrome-bug-1348019.https.html')
-rw-r--r-- | testing/web-platform/tests/screen-wake-lock/chrome-bug-1348019.https.html | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/testing/web-platform/tests/screen-wake-lock/chrome-bug-1348019.https.html b/testing/web-platform/tests/screen-wake-lock/chrome-bug-1348019.https.html new file mode 100644 index 0000000000..7c9909581c --- /dev/null +++ b/testing/web-platform/tests/screen-wake-lock/chrome-bug-1348019.https.html @@ -0,0 +1,35 @@ +<!DOCTYPE html> +<html> +<link rel="author" href="mailto:caseq@chromium.org"> +<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=1348019"> +<title>Releasing wake locks upon visibility change does not cause crash if an iframe is appended in event listener</title> +<body> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/resources/testdriver.js"></script> +<script src="/resources/testdriver-vendor.js"></script> +<script src="/page-visibility/resources/window_state_context.js"></script> +<script> +'use strict'; + +promise_test(async t => { + await test_driver.set_permission({ name: 'screen-wake-lock' }, 'granted'); + const { minimize } = window_state_context(t); + + const screenLock = await navigator.wakeLock.request('screen'); + + assert_false(screenLock.released, "The released attribute is initially false"); + + screenLock.addEventListener('release', () => { + const iframe = document.createElement('iframe'); + iframe.src = 'about:blank'; + document.body.appendChild(iframe); + }); + + const release = new EventWatcher(t, screenLock, 'release').wait_for('release'); + await Promise.all([minimize(), release]); + assert_true(screenLock.released, "The released attribute is true after the lock is released"); +}, "Appending iframe in release event listener does not cause a crash when page visibility changes"); +</script> +</body> +</html> |