Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(167)

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/security/cookies/websocket/first-party-cookie-not-blocked.html

Issue 2102993002: Fix WebSocket to set first party for cookies (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: a Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698