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

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

Issue 1745083002: CORS-RFC1918: Force preflights for external requests in DocumentThreadableLoader. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Test. Created 4 years, 8 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-same-site.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/cookies/same-site/popup-same-site.html b/third_party/WebKit/LayoutTests/http/tests/cookies/same-site/popup-same-site.html
index 737643833c86b8085da4e8cd753da3d1e71b35f1..1d2c209402c69787b75893b20f2f1383bc4ff2be 100644
--- a/third_party/WebKit/LayoutTests/http/tests/cookies/same-site/popup-same-site.html
+++ b/third_party/WebKit/LayoutTests/http/tests/cookies/same-site/popup-same-site.html
@@ -3,19 +3,23 @@
<script src="/resources/testharnessreport.js"></script>
<script src="/cookies/resources/testharness-helpers.js"></script>
<script>
-async_test(t => {
- 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=/";
+if (window.location.hostname == "127.0.0.1") {
+ window.location.hostname = ORIGINAL_HOST;
+} else if (window.location.hostname == ORIGINAL_HOST) {
+ async_test(t => {
+ 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.addEventListener("message", t.step_func_done(e => {
- assert_equals(e.data.http[STRICT_DOM], "1", "strict");
- assert_equals(e.data.http[LAX_DOM], "1", "lax");
- assert_equals(e.data.http[NORMAL_DOM], "1", "normal");
- assert_equals(e.data.document, STRICT_DOM + "=1; " + LAX_DOM + "=1; " + NORMAL_DOM + "=1");
- }));
+ window.addEventListener("message", t.step_func_done(e => {
+ assert_equals(e.data.http[STRICT_DOM], "1", "strict");
+ assert_equals(e.data.http[LAX_DOM], "1", "lax");
+ assert_equals(e.data.http[NORMAL_DOM], "1", "normal");
+ assert_equals(e.data.document, STRICT_DOM + "=1; " + LAX_DOM + "=1; " + NORMAL_DOM + "=1");
+ }));
- var i = window.open("http://" + ORIGINAL_HOST + ":8000/cookies/resources/post-cookies-to-opener.php");
-}, "'" + ORIGINAL_HOST + "' is same-site with itself, so samesite cookies are sent.");
+ var i = window.open("http://" + ORIGINAL_HOST + ":8000/cookies/resources/post-cookies-to-opener.php");
+ }, "'" + ORIGINAL_HOST + "' is same-site with itself, so samesite cookies are sent.");
+}
</script>

Powered by Google App Engine
This is Rietveld 408576698