Chromium Code Reviews| 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.setAlwaysAcceptCookies(false); | |
| 10 } | |
| 11 | |
| 12 const origin = WS_ORIGIN; | |
| 13 | |
| 14 async_test(t => { | |
|
yhirano
2016/07/06 11:19:08
[optional] I prefer promise_test to async_test if
tyoshino (SeeGerritForStatus)
2016/07/07 07:00:44
Changed
| |
| 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 assert_equals( | |
| 26 normalizeCookie(cookie), | |
| 27 'WK-WebSocket-test-domain-pass=1; WK-WebSocket-test-path-pass=1; ' + | |
| 28 'WK-WebSocket-test=1; same-site-lax=1; same-site-strict=1'); | |
| 29 return clear(origin); | |
| 30 }), | |
| 31 t.unreached_func('Cookie header lookup failed.') | |
| 32 ).then( | |
| 33 t.done.bind(t), | |
| 34 t.unreached_func('Failed to clear cookies.') | |
| 35 ); | |
| 36 }, "Test that first-party cookies not blocked for WebSockets."); | |
| 37 </script> | |
| OLD | NEW |