Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / websocket / cookie-ws-to-ws.html
blob2e00682e06157c7e059f84567df32aaf61979a1f
1 <!DOCTYPE html>
2 <script src="/js-test-resources/js-test.js"></script>
3 <script src="resources/get-request-header.js"></script>
4 <script>
5 description('Test receiving cookies in a WebSocket handshake which were set by another WebSocket handshake.');
7 window.jsTestIsAsync = true;
9 // Normalize a cookie string
10 function normalizeCookie(cookie) {
11 // Split the cookie string, sort it and then put it back together.
12 return cookie.split('; ').sort().join('; ');
15 var cookie;
16 var URL_SET_COOKIE = 'ws://127.0.0.1:8880/set-cookie';
17 var ws_set_cookie = new WebSocket(URL_SET_COOKIE);
19 ws_set_cookie.onopen = function () {
20 ws_set_cookie.close();
22 ws_set_cookie.onclose = function (e) {
23 connectAndGetRequestHeader('cookie').then(function(value) {
24 cookie = normalizeCookie(value);
25 shouldBeEqualToString('cookie', 'WK-WebSocket-test-domain-pass=1; WK-WebSocket-test-path-pass=1; WK-WebSocket-test=1');
26 clear();
27 }, finishAsFailed);
30 function clear() {
31 var ws = new WebSocket(URL_SET_COOKIE + '?clear=1');
32 ws.onopen = function () {
33 ws.close();
35 ws.onclose = finishJSTest;
37 setTimeout(finishJSTest, 1000);
38 </script>