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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/security/cookies/websocket/third-party-cookie.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>
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 var test = async_test('Test third-party cookie is accepted 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_not_equals(cookie, undefined,
24 'headers should contain a cookie header.');
25 assert_equals(normalizeCookie(cookie),
26 'WK-WebSocket-test-path-pass=1; WK-WebSocket-test=1');
27 return clear(CROSS_ORIGIN_WS_SERVER);
28 }),
29 test.unreached_func('cookie header lookup failed.')
30 ).then(
31 test.done.bind(test),
32 test.unreached_func('Failed to clear cookies.')
33 );
34 });
35 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698