JS Test Harness: Remove more link tags
[WebKit-https.git] / LayoutTests / http / tests / websocket / tests / hixie76 / null-character.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 transfer null character");
11
12 window.jsTestIsAsync = true;
13
14 var ws = new WebSocket("ws://127.0.0.1:8880/websocket/tests/hixie76/echo");
15 // \xff in string would be \xc3\xbf on websocket connection (UTF-8)
16 var expectedMessage = "Should Not\xff\0Split";
17
18 ws.onopen = function()
19 {
20     debug("WebSocket open");
21     ws.send(expectedMessage);
22 };
23
24 var msg;
25 ws.onmessage = function(messageEvent)
26 {
27     msg = messageEvent.data;
28     debug("msg should not be split by frame char \\xff\\0");
29     shouldBe("msg", "expectedMessage");
30     ws.close();
31 };
32
33 ws.onclose = function()
34 {
35     debug("WebSocket closed");
36     finishJSTest();
37 };
38
39 var successfullyParsed = true;
40 </script>
41 <script src="../../../../js-test-resources/js-test-post.js"></script>
42 </body>
43 </html>