summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/fenced-frame/popup-noopener.https.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /testing/web-platform/tests/fenced-frame/popup-noopener.https.html
parentInitial commit. (diff)
downloadfirefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz
firefox-26a029d407be480d791972afb5975cf62c9360a6.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/fenced-frame/popup-noopener.https.html')
-rw-r--r--testing/web-platform/tests/fenced-frame/popup-noopener.https.html57
1 files changed, 57 insertions, 0 deletions
diff --git a/testing/web-platform/tests/fenced-frame/popup-noopener.https.html b/testing/web-platform/tests/fenced-frame/popup-noopener.https.html
new file mode 100644
index 0000000000..9e7e8ce262
--- /dev/null
+++ b/testing/web-platform/tests/fenced-frame/popup-noopener.https.html
@@ -0,0 +1,57 @@
+<!DOCTYPE html>
+<title>Test popup created from a Fenced Frame Tree</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="resources/utils.js"></script>
+<script src="/common/utils.js"></script>
+
+<body>
+<script>
+// This key is used by `resources/popup-noopener-destination.html` to let us know if a
+// a new popup window is correctly opened without an opener.
+const popup_noopener_key = token();
+const kAssertion = "window.opener is null ";
+
+// This key is used by `resources/popup-noopener-inner.html` and
+// `resources/create-popup.html to let us know if a
+// a new popup window is correctly opened without an openee reference.
+const popup_openee_key = token();
+const kAssertion_openee = "openee is null ";
+
+// This key is used by `resources/popup-noopener-destination.html` to let us know if a
+// a new popup window is correctly opened without a name.
+const popup_name_key = token();
+const kAssertion_name = "window.name is empty string ";
+
+async function runTest(test_type) {
+ const fenced_frame =
+ attachFencedFrame(generateURL(
+ `resources/popup-noopener-inner.html`,
+ [popup_noopener_key, popup_openee_key, popup_name_key, test_type]));
+
+ result = await nextValueFromServer(popup_openee_key);
+ assert_equals(result, "PASS", kAssertion_openee + test_type);
+
+ result = await nextValueFromServer(popup_noopener_key);
+ assert_equals(result, "PASS", kAssertion + test_type);
+
+ result = await nextValueFromServer(popup_name_key);
+ assert_equals(result, "PASS", kAssertion + test_type);
+
+ // Clean up the fenced frame
+ document.body.removeChild(fenced_frame);
+}
+
+promise_test(async () => {
+ return runTest("top-level fenced frame");
+}, "Create popup from top-level fenced frame");
+
+promise_test(async () => {
+ return runTest("nested iframe");
+}, "Create popup from iframe nested in a fenced frame");
+
+promise_test(async () => {
+ return runTest("nested fenced frame");
+}, "Create popup from nested fenced frame");
+</script>
+</body>