JS Test Harness: Remove successfullyParsed from more tests
[WebKit-https.git] / LayoutTests / http / tests / websocket / tests / hybi / unicode.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("Web Socket unicode message test");
11
12 window.jsTestIsAsync = true;
13 if (window.layoutTestController)
14     layoutTestController.overridePreference("WebKitHixie76WebSocketProtocolEnabled", 0);
15
16 function endTest()
17 {
18     clearTimeout(timeoutID);
19     finishJSTest();
20 }
21
22 var ws = new WebSocket("ws://localhost:8880/websocket/tests/hybi/unicode");
23
24 // Hello in Japanese
25 var UNICODE_HELLO = "\u3053\u3093\u306b\u3061\u306f";
26 // Goodbye in Japanese
27 var UNICODE_GOODBYE = "\u3055\u3088\u3046\u306a\u3089";
28
29 // data needs to be global to be accessbile from shouldBe().
30 var data = "";
31
32 ws.onopen = function()
33 {
34     debug("Connected.");
35     debug("Send UNICODE_HELLO.");
36     ws.send(UNICODE_HELLO);
37 };
38
39 ws.onmessage = function(messageEvent)
40 {
41     // The server should send back Goodbye if it receives Hello.
42     data = messageEvent.data;
43     shouldBe("data", "UNICODE_GOODBYE");
44 };
45
46 ws.onclose = function()
47 {
48     debug("Closed.");
49     endTest();
50 };
51
52 function timeOutCallback()
53 {
54     testFailed("Timed out in state: " + ws.readyState);
55     endTest();
56 }
57
58 var timeoutID = setTimeout(timeOutCallback, 3000);
59
60 </script>
61 <script src="../../../../js-test-resources/js-test-post.js"></script>
62 </body>
63 </html>