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

Side by Side Diff: LayoutTests/http/tests/websocket/cookie-document-to-ws.html

Issue 315113002: Test that cookies set by document.cookie are sent in a WebSocket handshake. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/http/tests/websocket/cookie-document-to-ws-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/http/tests/websocket/cookie-document-to-ws-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698