4 <script src="/js-test-resources/js-test.js"></script>
7 <div id="description"></div>
8 <div id="console"></div>
10 description("Test whether WebSocket correctly responds to a ping message sent from the server.");
12 window.jsTestIsAsync = true;
14 var url = "ws://localhost:8880/pong";
15 var ws = new WebSocket(url);
19 ws.onopen = function()
21 debug("onopen() was called.");
24 ws.onmessage = function(event)
27 debug("onmessage() was called. (message = \"" + message + "\")");
28 shouldBeEqualToString("message", "PASS");
31 ws.onclose = function(event)
34 shouldBeTrue("closeEvent.wasClean");