| 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 // Don't block third-party cookies. |
| 9 testRunner.setAlwaysAcceptCookies(true); |
| 10 } |
| 11 |
| 12 const origin = WS_REMOTE_ORIGIN; |
| 13 |
| 14 async_test(t => { |
| 15 setCookie(origin).then( |
| 16 t.step_func(() => { |
| 17 return connectAndGetRequestHeadersFrom(origin); |
| 18 }), |
| 19 t.unreached_func('Failed to set cookie.') |
| 20 ).then( |
| 21 t.step_func(headers => { |
| 22 const cookie = headers['cookie']; |
| 23 assert_not_equals(cookie, undefined, |
| 24 'headers should contain a cookie header.'); |
| 25 // Same-site cookies are not included. |
| 26 assert_equals(normalizeCookie(cookie), |
| 27 'WK-WebSocket-test-path-pass=1; WK-WebSocket-test=1'); |
| 28 return clear(origin); |
| 29 }), |
| 30 t.unreached_func('Cookie header lookup failed.') |
| 31 ).then( |
| 32 t.done.bind(t), |
| 33 t.unreached_func('Failed to clear cookies.') |
| 34 ); |
| 35 }, "Test that third-party cookies are accepted for WebSockets when blocking " + |
| 36 "is disabled."); |
| 37 </script> |
| OLD | NEW |