Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / chrome / test / data / ssl / wss_close.html
blobebdc4315f1a7e2113523470d69a57b26b0ba8c0d
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>test to close hanging wss connection</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 queryBegin = href.lastIndexOf('?') + 1;
12 var port = href.slice(queryBegin);
13 var url = 'wss://' + host + ':' + port;
15 // Do connection test.
16 var ws = new WebSocket(url);
17 ws.onopen = function() {
18 // Set document title to 'FAIL'. The test observer catches this title change
19 // to know the result.
20 document.title = 'FAIL';
22 ws.onclose = function() {
23 // Set document title to 'PASS'. The test observer catches this title change
24 // to know the result.
25 document.title = 'PASS';
28 </script>
29 </head>
30 </html>