Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(88)

Unified Diff: third_party/WebKit/LayoutTests/http/tests/cookies/same-site/popup-cross-site-post.html

Issue 1783813002: SameSite: Strict/Lax behavior. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@strict-lax
Patch Set: Comment. Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/http/tests/cookies/same-site/popup-cross-site-post.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/cookies/same-site/popup-cross-site-post.html b/third_party/WebKit/LayoutTests/http/tests/cookies/same-site/popup-cross-site-post.html
new file mode 100644
index 0000000000000000000000000000000000000000..97fddfad88e613274e3440c6fe1db34f91e42905
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/cookies/same-site/popup-cross-site-post.html
@@ -0,0 +1,32 @@
+<!doctype html>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="/cookies/resources/testharness-helpers.js"></script>
+<script>
+// Set cookies on ORIGINAL_HOST, then move ourselves to TEST_ROOT so
+// we can verify cross-origin behavior.
+if (window.location.hostname == ORIGINAL_HOST) {
+ clearKnownCookies();
+ document.cookie = STRICT_DOM + "=1; SameSite=Strict; Max-Age=100; path=/";
+ document.cookie = LAX_DOM + "=1; SameSite=Lax; Max-Age=100; path=/";
+ document.cookie = NORMAL_DOM + "=1; Max-Age=100; path=/";
+ window.location.hostname = TEST_HOST;
+} else {
+ async_test(t => {
+ window.addEventListener("message", t.step_func_done(e => {
+ assert_equals(e.data.http[STRICT_DOM], undefined, "strict");
+ assert_equals(e.data.http[LAX_DOM], undefined, "lax");
+ assert_equals(e.data.http[NORMAL_DOM], "1", "normal");
+ // TODO(mkwst): This should exclude the samesite cookies.
+ assert_equals(e.data.document, STRICT_DOM + "=1; " + LAX_DOM + "=1; " + NORMAL_DOM + "=1");
+ e.source.close();
+ }));
+
+ var f = document.createElement('form');
+ f.action = "http://" + ORIGINAL_HOST + ":8000/cookies/resources/post-cookies-to-opener.php";
+ f.method = "POST";
+ f.target = "_blank"
+ window.onload = t.step_func(f.submit.bind(f));
+ }, "'" + ORIGINAL_HOST + "' is not same-site with '" + TEST_HOST + "', so samesite cookies are not sent via POST.");
+}
+</script>

Powered by Google App Engine
This is Rietveld 408576698