Record error when CreateDir fails.
[chromium-blink-merge.git] / net / data / websocket / connect_check.html
blob4a1ca8c5dfc0b7cb86b86f019a3a4038db867f35
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>test ws 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 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 + '/echo-with-no-extension';
17 // Do connection test.
18 var ws = new WebSocket(url);
20 ws.onopen = function()
22 // Set document title to 'PASS'. The test observer catches this title changes
23 // to know the result.
24 document.title = 'PASS';
27 ws.onclose = function()
29 // Set document title to 'FAIL'.
30 document.title = 'FAIL';
33 </script>
34 </head>
35 </html>