JS Test Harness: Remove more link tags
[WebKit-https.git] / LayoutTests / http / tests / websocket / tests / hixie76 / frame-length-skip.html
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="../../../../js-test-resources/js-test-pre.js"></script>
5 </head>
6 <body>
7 <div id="description"></div>
8 <div id="console"></div>
9 <script type="text/javascript">
10 description("Make sure WebSocket correctly skip lengthed frame.");
11
12 window.jsTestIsAsync = true;
13
14 var received_messages = [];
15 var expected_messages = ["hello", "world"];
16 function finish() {
17     clearTimeout(timeoutID);
18     debug(received_messages.length);
19     for (var i = 0; i < received_messages; i++) {
20         debug("received[" + i + "]=" + received_messages[i]);
21     }
22
23     shouldBeTrue("areArraysEqual(received_messages, expected_messages)");
24
25     finishJSTest();
26 }
27
28 var ws = new WebSocket("ws://127.0.0.1:8880/websocket/tests/hixie76/frame-length-skip");
29 ws.onopen = function () {
30     debug("WebSocket is open");
31 };
32 ws.onmessage = function (evt) {
33     debug("received:" + evt.data);
34     received_messages.push(evt.data);
35 };
36 ws.onclose = function () {
37     debug("WebSocket is closed");
38     finish();
39 };
40 var timeoutID = setTimeout("finish()", 2000);
41
42 var successfullyParsed = true;
43 </script>
44 <script src="../../../../js-test-resources/js-test-post.js"></script>
45 </body>
46 </html>