OLD | NEW |
---|---|
(Empty) | |
1 <html> | |
2 <body> | |
3 <script src="/js-test-resources/testharness.js"></script> | |
4 <script src="/js-test-resources/testharnessreport.js"></script> | |
5 <script> | |
6 var t = async_test('Cookies set by document.cookie are sent in a WebSocket hands hake'); | |
7 t.step(function() { | |
8 var cookie_id = 'test_' + Date.now() + '.' + Math.random(); | |
9 | |
10 document.cookie = cookie_id + '=1; Path=/echo-cookie'; | |
11 | |
12 new Promise(t.step_func(function(resolve, reject) { | |
13 var echo_ws = new WebSocket('ws://127.0.0.1:8880/echo-cookie'); | |
14 echo_ws.onmessage = t.step_func(function (e) { | |
15 resolve(e.data); | |
16 }); | |
17 echo_ws.onerror = t.step_func(function () { | |
18 reject('Unexpected error event'); | |
19 }); | |
20 echo_ws.onclose = t.step_func(function (e) { | |
21 reject('Unexpected close event: ' + e); | |
22 }); | |
23 })).then(t.step_func(function(actual) { | |
24 var expected = cookie_id + '=1'; | |
25 assert_equals(actual, expected); | |
26 | |
27 document.cookie = cookie_id + '=1; Path=/echo-cookie; Max-Age=0'; | |
Adam Rice
2014/06/05 03:47:50
If the test fails, the cookie will not be deleted.
tyoshino (SeeGerritForStatus)
2014/06/05 05:11:11
I believe so. content_shell processes are reused b
| |
28 | |
29 t.done(); | |
30 }), t.step_func(function(e) { | |
31 assert_unreached(e); | |
32 })); | |
33 }); | |
34 </script> | |
35 </body> | |
36 </html> | |
OLD | NEW |