| OLD | NEW |
| (Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="/js-test-resources/testharness.js"></script> |
| 3 <script src="/js-test-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.setAlwaysAcceptCookies(false); |
| 10 } |
| 11 |
| 12 var test = async_test('Test third-party cookie blocking for WebSocket'); |
| 13 |
| 14 test.step(() => { |
| 15 setCookie(CROSS_ORIGIN_WS_SERVER).then( |
| 16 test.step_func(() => { |
| 17 return connectAndGetRequestHeadersFrom(CROSS_ORIGIN_WS_SERVER); |
| 18 }), |
| 19 test.unreached_func('Failed to set cookie.') |
| 20 ).then( |
| 21 test.step_func(headers => { |
| 22 const cookie = headers['cookie']; |
| 23 assert_equals(cookie, undefined, |
| 24 'headers should not contain a cookie header.'); |
| 25 return clear(CROSS_ORIGIN_WS_SERVER); |
| 26 }), |
| 27 test.unreached_func('cookie header lookup failed.') |
| 28 ).then( |
| 29 test.done.bind(test), |
| 30 test.unreached_func('Failed to clear cookies.') |
| 31 ); |
| 32 }); |
| 33 </script> |
| OLD | NEW |