diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:50 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-15 03:34:50 +0000 |
commit | def92d1b8e9d373e2f6f27c366d578d97d8960c6 (patch) | |
tree | 2ef34b9ad8bb9a9220e05d60352558b15f513894 /dom/tests/mochitest/general/test_bug861217.html | |
parent | Adding debian version 125.0.3-1. (diff) | |
download | firefox-def92d1b8e9d373e2f6f27c366d578d97d8960c6.tar.xz firefox-def92d1b8e9d373e2f6f27c366d578d97d8960c6.zip |
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/tests/mochitest/general/test_bug861217.html')
-rw-r--r-- | dom/tests/mochitest/general/test_bug861217.html | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/dom/tests/mochitest/general/test_bug861217.html b/dom/tests/mochitest/general/test_bug861217.html index 1af3f58ff6..b758fe53e4 100644 --- a/dom/tests/mochitest/general/test_bug861217.html +++ b/dom/tests/mochitest/general/test_bug861217.html @@ -48,7 +48,34 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=861217 SimpleTest.waitForExplicitFinish(); /** Test for Bug 861217 **/ -function runTest() { +async function runTest() { + // This test needs to be run on environments where the zoom level == 1, but + // there are a couple of cases it's not run on such kind of environments. + // 1) run this test solely like mach mochitest dom/tests/mochitest/general/test_bug861217.html . + // In this case the zoom level is smaller than 1 since there's no meta viewport. + // 2) run test test along with other tests in the same directory. + // In this case this test runs inside an iframe in the mochitest harness' + // top level document which doesn't have any meta viewport either. + // To avoid these situations we forcibly set the zoom level 1 here. + const resolution = await SpecialPowers.spawn(window.top, [], () => { + return SpecialPowers.getDOMWindowUtils(content.window).getResolution(); + }); + + SimpleTest.registerCleanupFunction(async () => { + await SpecialPowers.spawn(window.top, [resolution], (aResolution) => { + SpecialPowers.getDOMWindowUtils(content.window).setResolutionAndScaleTo(aResolution); + }); + }); + await SpecialPowers.spawn(window.top, [], () => { + SpecialPowers.getDOMWindowUtils(content.window).setResolutionAndScaleTo(1.0); + }); + await SimpleTest.promiseWaitForCondition(async () => { + const resolution = await SpecialPowers.spawn(window.top, [], () => { + return SpecialPowers.getDOMWindowUtils(content.window).getResolution(); + }); + return resolution == 1.0; + }, "Waiting for zoom level 1.0"); + var tableCell1 = document.getElementById("tableCell1"), bcr1 = tableCell1.getBoundingClientRect(), tableCell2 = document.getElementById("tableCell2"), |