Lots of random cleanups, mostly for native_theme_win.cc:
[chromium-blink-merge.git] / net / data / websocket / split_packet_check.html
bloba7f4c365f56d6f0026bbcd3d1966943715e282f6
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>test ws split packet</title>
5 <script type="text/javascript">
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';
17 // Do connection test.
18 var ws = new WebSocket(url);
20 ws.onopen = function()
22 // Close WebSocket connection once it is established.
23 ws.close();
26 ws.onclose = function(event)
28 // Check wasClean, then set proper title.
29 if (event.wasClean && event.code === 3004 && event.reason === 'split test')
30 document.title = 'PASS';
31 else
32 document.title = 'FAIL';
35 </script>
36 </head>
37 </html>