| Index: third_party/WebKit/LayoutTests/http/tests/websocket/resources/cookie-test-util.js
|
| diff --git a/third_party/WebKit/LayoutTests/http/tests/websocket/resources/cookie-test-util.js b/third_party/WebKit/LayoutTests/http/tests/websocket/resources/cookie-test-util.js
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..9d5492eaf1e5b4ae131bfd8e03c355397b8049c6
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/http/tests/websocket/resources/cookie-test-util.js
|
| @@ -0,0 +1,25 @@
|
| +// Normalize a cookie string
|
| +function normalizeCookie(cookie) {
|
| + // Split the cookie string, sort it and then put it back together.
|
| + return cookie.split('; ').sort().join('; ');
|
| +}
|
| +
|
| +function clear(server) {
|
| + return new Promise(resolve => {
|
| + const ws = new WebSocket(server + '/set-cookie?clear=1');
|
| + ws.onopen = () => {
|
| + ws.close();
|
| + };
|
| + ws.onclose = resolve;
|
| + });
|
| +}
|
| +
|
| +function setCookie(server) {
|
| + return new Promise(resolve => {
|
| + const ws = new WebSocket(server + '/set-cookie');
|
| + ws.onopen = () => {
|
| + ws.close();
|
| + };
|
| + ws.onclose = resolve;
|
| + });
|
| +}
|
|
|