This is an automated email from the git hooks/post-receive script.
richard pushed a commit to branch tor-browser-91.9esr-11.0-1 in repository tor-browser.
commit cbc780482369134a9c29242192720d76c44dec82 Author: Edgar Chen echen@mozilla.com AuthorDate: Thu Apr 21 11:49:13 2022 +0000
Bug 1745915 - Add test for resizing a fullscreen window; r=smaug a=test-only
Differential Revision: https://phabricator.services.mozilla.com/D133742 --- dom/html/test/file_fullscreen-resize.html | 39 +++++++++++++++++++++++++++++++ dom/html/test/mochitest.ini | 1 + dom/html/test/test_fullscreen-api.html | 1 + 3 files changed, 41 insertions(+)
diff --git a/dom/html/test/file_fullscreen-resize.html b/dom/html/test/file_fullscreen-resize.html new file mode 100644 index 0000000000000..3050ba0d5d618 --- /dev/null +++ b/dom/html/test/file_fullscreen-resize.html @@ -0,0 +1,39 @@ +<!DOCTYPE HTML> +<html> +<!-- +https://bugzilla.mozilla.org/show_bug.cgi?id=1742421 +--> +<head> + <title>Test for Bug 1742421</title> + <script src="/tests/SimpleTest/SimpleTest.js"></script> + <script src="file_fullscreen-utils.js"></script> + <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> +</head> +<body style="background-color: gray;"> +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1742421">Mozilla Bug 1742421</a> +<p id="display"></p> +<div id="content" style="display: none"></div> +<pre id="test"> +<script type="application/javascript"> + +/** Test for Bug 1742421 **/ + +function begin() +{ + addFullscreenChangeContinuation("enter", () => { + opener.info("[resize] Entered fullscreen"); + // Do not use addFullscreenChangeContinuation for fullscreen exit given that + // it expects the window will be restored to the original size. + document.addEventListener("fullscreenchange", () => { + opener.ok(!document.fullscreenElement, "[resize] Should have left full-screen due to resize"); + opener.nextTest(); + }, { once: true }); + window.resizeBy(100,100); + }); + document.body.requestFullscreen(); +} + +</script> +</pre> +</body> +</html> diff --git a/dom/html/test/mochitest.ini b/dom/html/test/mochitest.ini index 0ee5715a2b030..ae8e256917908 100644 --- a/dom/html/test/mochitest.ini +++ b/dom/html/test/mochitest.ini @@ -471,6 +471,7 @@ support-files = file_fullscreen-table.html file_fullscreen-top-layer.html file_fullscreen-utils.js + file_fullscreen-resize.html [test_fullscreen_meta_viewport.html] support-files = file_fullscreen_meta_viewport.html
diff --git a/dom/html/test/test_fullscreen-api.html b/dom/html/test/test_fullscreen-api.html index 583c3bd755c6c..0da07aeb34b24 100644 --- a/dom/html/test/test_fullscreen-api.html +++ b/dom/html/test/test_fullscreen-api.html @@ -54,6 +54,7 @@ var gTestWindows = [ ["dom.security.featurePolicy.webidl.enabled", true]] }, { test: "file_fullscreen-async.html" }, { test: "file_fullscreen-sub-iframe.html" }, + { test: "file_fullscreen-resize.html" }, ];
var testWindow = null;