JS Test Harness: Remove more link tags
[WebKit-https.git] / LayoutTests / http / tests / websocket / tests / hybi / send-object-tostring-check.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 type="text/javascript">
10 description("WebSocket: Object's toString method should be called only once.");
11
12 window.jsTestIsAsync = true;
13 if (window.layoutTestController)
14     layoutTestController.overridePreference("WebKitHixie76WebSocketProtocolEnabled", 0);
15
16
17 var testObj = new function() {
18     this.callCounter = 0;
19     this.toString = function() {
20         this.callCounter++;
21     };
22 }
23
24 var url = "ws://127.0.0.1:8880/";
25 var ws = new WebSocket(url);
26 var closeEvent;
27
28
29 ws.onopen = function()
30 {
31     ws.send(testObj);
32 };
33
34 ws.onclose = function(event)
35 {
36     closeEvent = event;
37     shouldEvaluateTo("testObj.callCounter", 1);
38     shouldBeTrue("closeEvent.wasClean");
39     finishJSTest();
40 };
41
42 var successfullyParsed = true;
43 </script>
44 <script src="../../../../js-test-resources/js-test-post.js"></script>
45 </body>
46 </html>