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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/websocket/resources/cookie-test-util.js

Issue 2102993002: Fix WebSocket to set first party for cookies (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update testRunner calls to setBlockThirdPartyCookies() 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 // Normalize a cookie string
2 function normalizeCookie(cookie) {
3 // Split the cookie string, sort it and then put it back together.
4 return cookie.split('; ').sort().join('; ');
5 }
6
7 function clear(server) {
8 return new Promise(resolve => {
9 const ws = new WebSocket(server + '/set-cookie?clear=1');
10 ws.onopen = () => {
11 ws.close();
12 };
13 ws.onclose = resolve;
14 });
15 }
16
17 function setCookie(server) {
18 return new Promise(resolve => {
19 const ws = new WebSocket(server + '/set-cookie');
20 ws.onopen = () => {
21 ws.close();
22 };
23 ws.onclose = resolve;
24 });
25 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698