summaryrefslogtreecommitdiffstats
path: root/dom/ipc/tests/JSWindowActor/browser_contentWindow.js
diff options
context:
space:
mode:
Diffstat (limited to 'dom/ipc/tests/JSWindowActor/browser_contentWindow.js')
-rw-r--r--dom/ipc/tests/JSWindowActor/browser_contentWindow.js35
1 files changed, 35 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..e061fd895c
--- /dev/null
+++ b/dom/ipc/tests/JSWindowActor/browser_contentWindow.js
@@ -0,0 +1,35 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+"use strict";
+
+const CONTENT_WINDOW_URL = "https://example.com/";
+
+declTest("contentWindow null when inner window inactive", {
+ matches: [CONTENT_WINDOW_URL + "*"],
+ url: CONTENT_WINDOW_URL + "?1",
+
+ async test(browser) {
+ // If Fission is disabled, the pref is no-op.
+ await SpecialPowers.pushPrefEnv({
+ set: [["fission.bfcacheInParent", true]],
+ });
+
+ let parent = browser.browsingContext.currentWindowGlobal;
+ let actorParent = parent.getActor("TestWindow");
+
+ await actorParent.sendQuery("storeActor");
+
+ let url = CONTENT_WINDOW_URL + "?2";
+ let loaded = BrowserTestUtils.browserLoaded(browser, false, url);
+ BrowserTestUtils.startLoadingURIString(browser, url);
+ await loaded;
+
+ let result = await actorParent.sendQuery("checkActor");
+
+ is(result.status, "success", "Should succeed when bfcache is enabled");
+ ok(
+ result.valueIsNull,
+ "Should get a null contentWindow when inner window is inactive"
+ );
+ },
+});