JS Test Harness: Remove more link tags
[WebKit-https.git] / LayoutTests / http / tests / websocket / tests / hybi / send-empty.html
1 <!DOCTYPE html>
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>
10 description("WebSocket: Calling send() without arguments should raise SyntaxError.");
11
12 window.jsTestIsAsync = true;
13 if (window.layoutTestController)
14     layoutTestController.overridePreference("WebKitHixie76WebSocketProtocolEnabled", 0);
15
16 var ws = new WebSocket("ws://127.0.0.1:8880/websocket/tests/hybi/echo");
17
18 var closeEvent;
19 var receivedMessages = [];
20 var expectedMessages = ["Goodbye"];
21
22 ws.onopen = function()
23 {
24     shouldThrow("ws.send()");
25     ws.send("Goodbye");
26 };
27
28 ws.onmessage = function(event)
29 {
30     receivedMessages.push(event.data);
31 };
32
33 ws.onclose = function(event)
34 {
35     closeEvent = event;
36     shouldBeTrue("closeEvent.wasClean");
37
38     shouldEvaluateTo("receivedMessages.length", expectedMessages.length);
39     for (var i = 0; i < expectedMessages.length; ++i)
40         shouldBeEqualToString("receivedMessages[" + i + "]", expectedMessages[i]);
41     finishJSTest();
42 };
43
44 var successfullyParsed = true;
45 </script>
46 <script src="../../../../js-test-resources/js-test-post.js"></script>
47 </body>
48 </html>