1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
4 <script src="../../../../js-test-resources/js-test-pre.js"></script>
7 <div id="description"></div>
8 <div id="console"></div>
9 <script type="text/javascript">
10 description("Make sure WebSocket transfer null character");
12 window.jsTestIsAsync = true;
13 if (window.layoutTestController)
14 layoutTestController.overridePreference("WebKitHixie76WebSocketProtocolEnabled", 0);
16 var ws = new WebSocket("ws://127.0.0.1:8880/websocket/tests/hybi/echo");
17 // \xff in string would be \xc3\xbf on websocket connection (UTF-8)
18 var expectedMessage = "Should Not\xff\0Split";
20 ws.onopen = function()
22 debug("WebSocket open");
23 ws.send(expectedMessage);
27 ws.onmessage = function(messageEvent)
29 msg = messageEvent.data;
30 debug("msg should not be split by frame char \\xff\\0");
31 shouldBe("msg", "expectedMessage");
35 ws.onclose = function()
37 debug("WebSocket closed");
42 <script src="../../../../js-test-resources/js-test-post.js"></script>