summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/cookies/domain/domain-attribute-host-with-leading-period.sub.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/cookies/domain/domain-attribute-host-with-leading-period.sub.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/cookies/domain/domain-attribute-host-with-leading-period.sub.https.html')
-rw-r--r--testing/web-platform/tests/cookies/domain/domain-attribute-host-with-leading-period.sub.https.html39
1 files changed, 39 insertions, 0 deletions
diff --git a/testing/web-platform/tests/cookies/domain/domain-attribute-host-with-leading-period.sub.https.html b/testing/web-platform/tests/cookies/domain/domain-attribute-host-with-leading-period.sub.https.html
new file mode 100644
index 0000000000..3ec52fd40b
--- /dev/null
+++ b/testing/web-platform/tests/cookies/domain/domain-attribute-host-with-leading-period.sub.https.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<head>
+ <script src="/resources/testharness.js"></script>
+ <script src="/resources/testharnessreport.js"></script>
+ <script src="/cookies/resources/cookie-helper.sub.js"></script>
+</head>
+<body>
+ <script>
+ //
+ // Set-Cookie: domain-attribute-host-with-leading-period=b; Path=/; Domain=.{{host}}
+ //
+ const cookieName = "domain-attribute-host-with-leading-period";
+ // Clean up cookie at the end to avoid interfering with subsequent tests.
+ add_completion_callback(tests => document.cookie =
+ `${cookieName}=0; Path=/; Domain=.{{host}}; expires=01-jan-1970 00:00:00 GMT`);
+
+ test(t => {
+ assert_dom_cookie(cookieName, "b", true);
+ }, "Domain=.{{host}} => available via `document.cookie`");
+
+ async_test(t => {
+ fetch("/cookies/resources/list.py", { credentials: "include" })
+ .then(t.step_func(r => r.json()))
+ .then(t.step_func_done(r => {
+ assert_equals(r[cookieName], "b");
+ }))
+ .catch(_ => assert_unreached);
+ }, "Domain=.{{host}} => sent with same-origin requests.");
+
+ async_test(t => {
+ fetch(`${SECURE_SUBDOMAIN_ORIGIN}/cookies/resources/list.py`, { credentials: "include" })
+ .then(t.step_func(r => r.json()))
+ .then(t.step_func_done(r => {
+ assert_equals(r[cookieName], "b");
+ }))
+ .catch(_ => assert_unreached);
+ }, "Domain=.{{host}} => sent with subdomain requests.");
+ </script>
+</body>