Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <script src="/js-test-resources/testharness.js"></script> | |
| 3 <script src="/js-test-resources/testharnessreport.js"></script> | |
|
Mike West
2016/06/28 11:25:37
Nit: Just `/resources/`
tyoshino (SeeGerritForStatus)
2016/06/30 08:24:13
Oh. It's no longer preferred? Done.
| |
| 4 <script src="../../../websocket/resources/get-request-header.js"></script> | |
| 5 <script src="../../../websocket/resources/cookie-test-util.js"></script> | |
|
Mike West
2016/06/28 11:25:37
Nit: I think that just `/websocket` is a little si
tyoshino (SeeGerritForStatus)
2016/06/30 08:24:13
Done. Yeah, I often use relative path so that we c
| |
| 6 <script> | |
| 7 if (window.testRunner) { | |
| 8 // Block third-party cookies. | |
| 9 testRunner.setAlwaysAcceptCookies(false); | |
|
Mike West
2016/06/28 11:25:37
Nit: Would you mind filing a bug to rename this? I
tyoshino (SeeGerritForStatus)
2016/06/30 08:24:13
Created crbug.com/624711
| |
| 10 } | |
| 11 | |
| 12 var test = async_test('Test first-party cookie is not blocked for WebSocket'); | |
|
Mike West
2016/06/28 11:25:37
Style nit: I usually end up writing this as:
```
tyoshino (SeeGerritForStatus)
2016/06/30 08:24:13
Yeah, sorry. I've been a bit away from layout test
| |
| 13 | |
| 14 test.step(() => { | |
| 15 setCookie(SAME_ORIGIN_WS_SERVER).then( | |
| 16 test.step_func(() => { | |
| 17 return connectAndGetRequestHeadersFrom(SAME_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_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'); | |
| 29 return clear(SAME_ORIGIN_WS_SERVER); | |
| 30 }), | |
| 31 test.unreached_func('cookie header lookup failed.') | |
| 32 ).then( | |
| 33 test.done.bind(test), | |
| 34 test.unreached_func('Failed to clear cookies.') | |
| 35 ); | |
| 36 }); | |
| 37 </script> | |
| OLD | NEW |