diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-28 14:29:10 +0000 |
commit | 2aa4a82499d4becd2284cdb482213d541b8804dd (patch) | |
tree | b80bf8bf13c3766139fbacc530efd0dd9d54394c /toolkit/components/printing/tests/browser_preview_print_coop.js | |
parent | Initial commit. (diff) | |
download | firefox-upstream.tar.xz firefox-upstream.zip |
Adding upstream version 86.0.1.upstream/86.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/components/printing/tests/browser_preview_print_coop.js')
-rw-r--r-- | toolkit/components/printing/tests/browser_preview_print_coop.js | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/toolkit/components/printing/tests/browser_preview_print_coop.js b/toolkit/components/printing/tests/browser_preview_print_coop.js new file mode 100644 index 0000000000..b635ca82a7 --- /dev/null +++ b/toolkit/components/printing/tests/browser_preview_print_coop.js @@ -0,0 +1,40 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +const TEST_PATH = getRootDirectory(gTestPath).replace( + "chrome://mochitests/content", + "https://example.com" +); + +/** + * Verify if the page with a COOP header can be used for printing preview. + */ +add_task(async function test() { + await SpecialPowers.pushPrefEnv({ + set: [["print.tab_modal.enabled", false]], + }); + + let tab = await BrowserTestUtils.openNewForegroundTab( + gBrowser, + `${TEST_PATH}file_coop_header.html` + ); + + // Enter print preview + let ppBrowser = PrintPreviewListener.getPrintPreviewBrowser(); + let ppPromise = PrintHelper.waitForOldPrintPreview(ppBrowser); + document.getElementById("cmd_printPreview").doCommand(); + await ppPromise; + + await BrowserTestUtils.waitForCondition( + () => gInPrintPreviewMode, + "Should be in print preview mode now." + ); + + ok(true, "We did not crash."); + + PrintUtils.exitPrintPreview(); + + BrowserTestUtils.removeTab(tab); +}); |