diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /dom/base/test/fullscreen/file_fullscreen-esc-exit.html | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/base/test/fullscreen/file_fullscreen-esc-exit.html')
-rw-r--r-- | dom/base/test/fullscreen/file_fullscreen-esc-exit.html | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/dom/base/test/fullscreen/file_fullscreen-esc-exit.html b/dom/base/test/fullscreen/file_fullscreen-esc-exit.html new file mode 100644 index 0000000000..f65f930b3f --- /dev/null +++ b/dom/base/test/fullscreen/file_fullscreen-esc-exit.html @@ -0,0 +1,63 @@ +<!DOCTYPE HTML> +<html> +<!-- +https://bugzilla.mozilla.org/show_bug.cgi?id=700764 + +Verify that an ESC key press in a subdoc of a full-screen doc causes us to +exit DOM full-screen mode. + +--> +<head> + <title>Test for Bug 700764</title> + <script src="/tests/SimpleTest/SimpleTest.js"></script> + <script src="/tests/SimpleTest/EventUtils.js"></script> + <script type="application/javascript" src="file_fullscreen-utils.js"></script> + <style> + body:fullscreen, div:fullscreen { + background-color: red; + } + </style> +</head> +<body> + +<script type="application/javascript"> + +function ok(condition, msg) { + opener.ok(condition, "[esc-exit] " + msg); +} + +function is(a, b, msg) { + opener.is(a, b, "[esc-exit] " + msg); +} + +function finish() { + opener.nextTest(); +} + +function fullscreenchange1(event) { + 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) { + 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"); + finish(); +} + +function begin() { + addFullscreenChangeContinuation("enter", fullscreenchange1); + document.body.requestFullscreen(); +} + +</script> + +<!-- This subframe conducts the test. --> +<iframe id="subdoc" src="file_fullscreen-esc-exit-inner.html"></iframe> + +</pre> +</body> +</html> |