1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
4 <script src="../../../../js-test-resources/js-test-pre.js"></script>
7 <div id="description"></div>
8 <div id="console"></div>
10 description('Connection should fail immediately, rather than succeeding or staying in limbo until timeout, if handshake is longer than 1024 bytes.');
12 window.jsTestIsAsync = true;
15 var connected = false;
19 shouldBeFalse('timedOut');
20 shouldBeFalse('connected');
21 shouldBeUndefined('origin');
22 clearTimeout(timeoutID);
26 var url = 'ws://localhost:8880/websocket/tests/hixie76/handshake-fail-by-maxlength';
27 var ws = new WebSocket(url);
29 ws.onopen = function()
35 ws.onmessage = function(messageEvent)
37 origin = messageEvent.data;
38 debug('origin = ' + origin);
42 ws.onclose = function()
47 function timeoutCallback()
49 debug('Timed out (state = ' + ws.readyState + ')');
54 var timeoutID = setTimeout(timeoutCallback, 3000);
57 <script src="../../../../js-test-resources/js-test-post.js"></script>