Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / http / tests / websocket / send.html
blob31bd18d374d062489c21c9885d744e21125161e1
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <script src="/js-test-resources/js-test.js"></script>
5 </head>
6 <body>
7 <div id="description"></div>
8 <div id="console"></div>
9 <script type="text/javascript">
10 description("WebSocket send test");
12 window.jsTestIsAsync = true;
14 function endTest()
16 clearTimeout(timeoutID);
17 finishJSTest();
20 var ws = new WebSocket("ws://localhost:8880/send");
22 var FIRST_MESSAGE_TO_SEND = "This is the first message to send to the server.";
23 var SECOND_MESSAGE_TO_SEND = "This is the second.";
24 // data needs to be global to be accessbile from shouldBe().
25 var data = "";
27 ws.onopen = function()
29 debug("Connected.");
30 ws.send(FIRST_MESSAGE_TO_SEND);
33 ws.onmessage = function(messageEvent)
35 // The server should echo back the first message.
36 data = messageEvent.data;
37 shouldBe("data", "FIRST_MESSAGE_TO_SEND");
38 ws.onmessage = function(messageEvent) {
39 // The server should echo back the second message.
40 data = messageEvent.data;
41 shouldBe("data", "SECOND_MESSAGE_TO_SEND");
43 ws.send(SECOND_MESSAGE_TO_SEND);
46 ws.onclose = function()
48 debug("Closed.");
49 endTest();
52 function timeOutCallback()
54 testFailed("Timed out in state: " + ws.readyState);
55 endTest();
58 var timeoutID = setTimeout(timeOutCallback, 3000);
60 </script>
61 </body>
62 </html>