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 /dom/ipc/tests/JSWindowActor/browser_contentWindow.js | |
parent | Initial commit. (diff) | |
download | firefox-2aa4a82499d4becd2284cdb482213d541b8804dd.tar.xz firefox-2aa4a82499d4becd2284cdb482213d541b8804dd.zip |
Adding upstream version 86.0.1.upstream/86.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/ipc/tests/JSWindowActor/browser_contentWindow.js')
-rw-r--r-- | dom/ipc/tests/JSWindowActor/browser_contentWindow.js | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/dom/ipc/tests/JSWindowActor/browser_contentWindow.js b/dom/ipc/tests/JSWindowActor/browser_contentWindow.js new file mode 100644 index 0000000000..cfdc5b114f --- /dev/null +++ b/dom/ipc/tests/JSWindowActor/browser_contentWindow.js @@ -0,0 +1,47 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ +"use strict"; + +declTest("contentWindow null when inner window inactive", { + matches: [TEST_URL + "*"], + url: TEST_URL + "?1", + + async test(browser) { + { + let parent = browser.browsingContext.currentWindowGlobal; + let actorParent = parent.getActor("TestWindow"); + + await actorParent.sendQuery("storeActor"); + } + + { + let url = TEST_URL + "?2"; + let loaded = BrowserTestUtils.browserLoaded(browser, false, url); + await BrowserTestUtils.loadURI(browser, url); + await loaded; + } + + let parent = browser.browsingContext.currentWindowGlobal; + let actorParent = parent.getActor("TestWindow"); + + let result = await actorParent.sendQuery("checkActor"); + if (SpecialPowers.useRemoteSubframes) { + is( + result.status, + "error", + "Should get an error when bfcache is disabled for Fission" + ); + is( + result.errorType, + "InvalidStateError", + "Should get an InvalidStateError without bfcache" + ); + } else { + is(result.status, "success", "Should succeed when bfcache is enabled"); + ok( + result.valueIsNull, + "Should get a null contentWindow when inner window is inactive" + ); + } + }, +}); |