Index: third_party/WebKit/LayoutTests/http/tests/cookies/same-site/popup-same-site-post.html |
diff --git a/third_party/WebKit/LayoutTests/http/tests/cookies/same-site/popup-same-site-post.html b/third_party/WebKit/LayoutTests/http/tests/cookies/same-site/popup-same-site-post.html |
index 2ec2c546c1892bc01ee6edb3d1c2052d8d88b0eb..eee74be3e785939e8564e1203c28ba17d14d4b25 100644 |
--- a/third_party/WebKit/LayoutTests/http/tests/cookies/same-site/popup-same-site-post.html |
+++ b/third_party/WebKit/LayoutTests/http/tests/cookies/same-site/popup-same-site-post.html |
@@ -3,24 +3,28 @@ |
<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"); |
- e.source.close(); |
- })); |
+ 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"); |
+ 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 same-site with itself, so samesite cookies are sent."); |
+ 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 same-site with itself, so samesite cookies are sent."); |
+} |
</script> |