diff options
Diffstat (limited to 'testing/web-platform/tests/cookies/third-party-cookies/resources/third-party-cookies-cross-site-window.html')
-rw-r--r-- | testing/web-platform/tests/cookies/third-party-cookies/resources/third-party-cookies-cross-site-window.html | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/testing/web-platform/tests/cookies/third-party-cookies/resources/third-party-cookies-cross-site-window.html b/testing/web-platform/tests/cookies/third-party-cookies/resources/third-party-cookies-cross-site-window.html deleted file mode 100644 index 99418a6749..0000000000 --- a/testing/web-platform/tests/cookies/third-party-cookies/resources/third-party-cookies-cross-site-window.html +++ /dev/null @@ -1,62 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"/> -<meta name="timeout" content="long"> -<title>Cross-site window</title> -<script src="/resources/testharness.js"></script> -<script src="/common/get-host-info.sub.js"></script> -<script src="/cookies/resources/cookie-helper.sub.js"></script> -<script src="/cookies/third-party-cookies/resources/test-helpers.js"></script> - -<body> -<script> - -let origin; - -// Test that parent window passed its origin in the URL parameters correctly. -test(() => { - assert_true(window.location.search.startsWith("?origin=")); - origin = decodeURIComponent(window.location.search.slice( - window.location.search.indexOf("?origin=") + 8)); -}, "Cross-site window opened correctly"); - -// Cookies set by the parent window in a 1P context. -const cookieNames = ["1P_http", "1P_dom"]; -if (window.cookieStore) { - cookieNames.push("1P_cs"); -} - -// Test theses cookies are not available on cross-site subresource requests -// to the origin that set them. -testHttpCookies({ - desc: "3P fetch", - origin, - cookieNames, - expectsCookie: false, -}); - -promise_test(async () => { - const thirdPartyHttpCookie = "3P_http" - await credFetch( - `${origin}/cookies/resources/set.py?${thirdPartyHttpCookie}=foobar;` + - "Secure;Path=/;SameSite=None"); - await assertOriginCanAccessCookies({ - origin, - cookieNames: ["3P_http"], - expectsCookie: false, - }); -}, "Cross site window setting HTTP cookies"); - -// Create a cross-site <iframe> which embeds the cookies' origin into this -// page. -const iframe = document.createElement("iframe"); -const url = new URL( - "/cookies/third-party-cookies/resources/" + - "third-party-cookies-cross-site-embed.html", - origin); -iframe.src = String(url); -document.body.appendChild(iframe); - -fetch_tests_from_window(iframe.contentWindow); - -</script> -</body> |