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

Side by Side Diff: LayoutTests/http/tests/websocket/tests/hybi/handshake-fail-by-null-subprotocol-selection.html

Issue 22375002: WebSocket must not be established when subprotocol is not selected by the server (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix test description Created 7 years, 4 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
« no previous file with comments | « no previous file | LayoutTests/http/tests/websocket/tests/hybi/handshake-fail-by-null-subprotocol-selection-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
1 <!DOCTYPE HTML> 1 <!DOCTYPE HTML>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="/js-test-resources/js-test-pre.js"></script> 4 <script src="/js-test-resources/js-test-pre.js"></script>
5 </head> 5 </head>
6 <body> 6 <body>
7 <div id="description"></div> 7 <div id="description"></div>
8 <div id="console"></div> 8 <div id="console"></div>
9 <script> 9 <script>
10 description("Test whether WebSocket handshake fails if the server sends incorrec t Sec-WebSocket-Accept header."); 10 description("Test for verifying that the WebSocket handshake fails when the clie nt requests a subprotocol but the server doesn't include a Sec-WebSocket-Protoco l header in the response.");
11 11
12 window.jsTestIsAsync = true; 12 window.jsTestIsAsync = true;
13 13
14 var url = "ws://localhost:8880/websocket/tests/hybi/handshake-fail-by-wrong-acce pt-header"; 14 var url = "ws://localhost:8880/websocket/tests/hybi/handshake-fail-by-null-subpr otocol-selection";
15 var ws = new WebSocket(url); 15 var ws = new WebSocket(url, 'test');
16 var closeEvent; 16 var closeEvent;
17 17
18 ws.onopen = function() 18 ws.onopen = function()
19 { 19 {
20 testFailed("Connection established."); 20 testFailed("Connection established.");
21 ws.close(); 21 ws.close();
22 }; 22 };
23 23
24 ws.onclose = function(event) 24 ws.onclose = function(event)
25 { 25 {
26 closeEvent = event; 26 closeEvent = event;
27 shouldBeFalse("closeEvent.wasClean"); 27 shouldBeFalse("closeEvent.wasClean");
28 finishJSTest(); 28 finishJSTest();
29 }; 29 };
30 30
31 </script> 31 </script>
32 <script src="/js-test-resources/js-test-post.js"></script> 32 <script src="/js-test-resources/js-test-post.js"></script>
33 </body> 33 </body>
34 </html> 34 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/http/tests/websocket/tests/hybi/handshake-fail-by-null-subprotocol-selection-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698