JS Test Harness: Remove more link tags
[WebKit-https.git] / LayoutTests / http / tests / websocket / tests / hixie76 / simple.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("Simple Web Socket test");
11
12 window.jsTestIsAsync = true;
13
14 function endTest()
15 {
16     clearTimeout(timeoutID);
17     finishJSTest();
18 }
19
20 var ws = new WebSocket("ws://127.0.0.1:8880/websocket/tests/hixie76/simple");
21 debug("Created a socket to '" + ws.URL + "'; readyState " + ws.readyState + ".");
22
23 ws.onopen = function()
24 {
25     debug("Connected; readyState " + ws.readyState);
26 };
27
28 ws.onmessage = function(messageEvent)
29 {
30     debug("Received: '" + messageEvent.data + "'; readyState " + ws.readyState);
31 };
32
33 ws.onclose = function()
34 {
35     debug("Closed; readyState " + ws.readyState + ".");
36     endTest();
37 };
38
39 function timeOutCallback()
40 {
41     debug("Timed out in state: " + ws.readyState);
42     endTest();
43 }
44
45 var timeoutID = setTimeout(timeOutCallback, 3000);
46
47 var successfullyParsed = true;
48 </script>
49 <script src="../../../../js-test-resources/js-test-post.js"></script>
50 </body>
51 </html>