diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /testing/web-platform/tests/fenced-frame/header-referrer.https.html | |
parent | Initial commit. (diff) | |
download | firefox-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/header-referrer.https.html')
-rw-r--r-- | testing/web-platform/tests/fenced-frame/header-referrer.https.html | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/testing/web-platform/tests/fenced-frame/header-referrer.https.html b/testing/web-platform/tests/fenced-frame/header-referrer.https.html new file mode 100644 index 0000000000..b6323962d8 --- /dev/null +++ b/testing/web-platform/tests/fenced-frame/header-referrer.https.html @@ -0,0 +1,55 @@ +<!DOCTYPE html> +<title>Test `Referer` header</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> +promise_test(async () => { + const referrer_key = token(); + const referrer_ack_key = token(); + + const check_url = generateURL('resources/check-header-referrer.py', + [referrer_key]) + attachFencedFrame(check_url); + + const expected_referrer = ""; + const actual_referrer = await nextValueFromServer(referrer_key); + assert_equals(actual_referrer, expected_referrer, + "The top-level fenced frame has the right value for " + + "`Referer` header"); + + const inner_url = generateURL('resources/header-referrer-inner.html', + [referrer_key, referrer_ack_key]) + attachFencedFrame(inner_url); + + const iframe_expected_referrer = inner_url.toString().replace("%2C", ","); + + const iframe_actual_referrer = await nextValueFromServer(referrer_key); + assert_equals(iframe_actual_referrer, iframe_expected_referrer, + "The iframe inside the fenced frame has the right value for " + + "`Referer` header"); + + writeValueToServer(referrer_ack_key, "ACK"); + + const nested_fenced_frame_expected_referrer = ""; + const nested_fenced_frame_actual_referrer = await nextValueFromServer(referrer_key); + assert_equals(nested_fenced_frame_actual_referrer, nested_fenced_frame_expected_referrer, + "The nested fenced frame has the right value for " + + "`Referer` header"); + + writeValueToServer(referrer_ack_key, "ACK"); + + const navigate_self_expected_referrer = + inner_url.toString().replace("%2C", ","); + const navigate_self_actual_referrer = await nextValueFromServer(referrer_key); + assert_equals(navigate_self_actual_referrer, navigate_self_expected_referrer, + "The fenced frame after it navigates itself has the right value for " + + "`Referer` header"); +}, "header.referrer"); +</script> + +</body> |