| OLD | NEW |
| (Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="/resources/testharness.js"></script> |
| 3 <script src="/resources/testharnessreport.js"></script> |
| 4 <script src="/websocket/resources/get-request-header.js"></script> |
| 5 <script src="/websocket/resources/cookie-test-util.js"></script> |
| 6 <script> |
| 7 if (window.testRunner) { |
| 8 // Block third-party cookies. |
| 9 testRunner.setBlockThirdPartyCookies(true); |
| 10 } |
| 11 |
| 12 const origin = WS_ORIGIN; |
| 13 |
| 14 promise_test(() => { |
| 15 return setCookie(origin).then( |
| 16 () => { |
| 17 return connectAndGetRequestHeadersFrom(origin); |
| 18 } |
| 19 ).then( |
| 20 headers => { |
| 21 const cookie = headers['cookie']; |
| 22 assert_not_equals(cookie, undefined, |
| 23 'headers should contain a cookie header.'); |
| 24 assert_equals( |
| 25 normalizeCookie(cookie), |
| 26 'same-site-lax=1; same-site-strict=1; ws-domain-local-ip=1; ' + |
| 27 'ws-path-root=1; ws=1'); |
| 28 return clear(origin); |
| 29 } |
| 30 ); |
| 31 }, "Test that first-party cookies not blocked for WebSockets."); |
| 32 </script> |
| OLD | NEW |