1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
4 <script src="/js-test-resources/js-test.js"></script>
7 <div id="description"></div>
8 <div id="console"></div>
9 <script type="text/javascript">
10 description('Handshake should fail when the first line does not end with CRLF.');
12 window.jsTestIsAsync = true;
14 var connected = false;
18 shouldBeFalse('connected');
19 shouldBeUndefined('origin');
20 clearTimeout(timeoutID);
24 var url = 'ws://localhost:8880/handshake-fail-by-no-cr';
25 var ws = new WebSocket(url);
27 ws.onopen = function()
33 ws.onmessage = function(messageEvent)
35 origin = messageEvent.data;
36 debug('origin = ' + origin);
40 ws.onclose = function()
45 function timeoutCallback()
47 debug('Timed out (state = ' + ws.readyState + ')');
51 var timeoutID = setTimeout(timeoutCallback, 3000);