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

Side by Side Diff: net/data/websocket/split_packet_check.html

Issue 416333004: Revert of [WebSocket] Send a close frame when the renderer process is gone. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | Annotate | Revision Log
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <title>test ws split packet</title> 4 <title>test ws split packet</title>
5 <script type="text/javascript"> 5 <script type="text/javascript">
6 var protocol = location.protocol.replace('http', 'ws'); 6
7 var url = protocol + '//' + location.host + '/close-with-split-packet'; 7 var href = window.location.href;
8 var hostBegin = href.indexOf('/') + 2;
9 var hostEnd = href.lastIndexOf(':');
10 var host = href.slice(hostBegin, hostEnd);
11 var portBegin = hostEnd + 1;
12 var portEnd = href.lastIndexOf('/');
13 var port = href.slice(portBegin, portEnd);
14 var scheme = href.indexOf('https') >= 0 ? 'wss' : 'ws';
15 var url = scheme + '://' + host + ':' + port + '/close-with-split-packet';
8 16
9 // Do connection test. 17 // Do connection test.
10 var ws = new WebSocket(url); 18 var ws = new WebSocket(url);
11 19
12 ws.onopen = function() 20 ws.onopen = function()
13 { 21 {
14 // Close WebSocket connection once it is established. 22 // Close WebSocket connection once it is established.
15 ws.close(); 23 ws.close();
16 } 24 }
17 25
18 ws.onclose = function(event) 26 ws.onclose = function(event)
19 { 27 {
20 // Check wasClean, then set proper title. 28 // Check wasClean, then set proper title.
21 if (event.wasClean && event.code === 3004 && event.reason === 'split test') 29 if (event.wasClean && event.code === 3004 && event.reason === 'split test')
22 document.title = 'PASS'; 30 document.title = 'PASS';
23 else 31 else
24 document.title = 'FAIL'; 32 document.title = 'FAIL';
25 } 33 }
26 34
27 </script> 35 </script>
28 </head> 36 </head>
29 </html> 37 </html>
OLDNEW
« no previous file with comments | « net/data/websocket/counted_connection.html ('k') | net/data/websocket/websocket_shared_worker.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698