1 <!DOCTYPE HTML PUBLIC
"-//IETF//DTD HTML//EN">
4 <script src=
"/js-test-resources/js-test.js"></script>
7 <div id=
"description"></div>
8 <div id=
"console"></div>
9 <script type=
"text/javascript">
10 description("WebSocket send test");
12 window
.jsTestIsAsync
= true;
16 clearTimeout(timeoutID
);
20 var ws
= new WebSocket("ws://localhost:8880/send");
22 var FIRST_MESSAGE_TO_SEND
= {
23 toString: function() { throw "Pickles"; }
25 // data needs to be global to be accessbile from shouldBe().
28 ws
.onopen = function()
32 ws
.send(FIRST_MESSAGE_TO_SEND
);
34 debug("Caught exception: " + ex
);
39 ws
.onclose = function()
45 function timeOutCallback()
47 testFailed("Timed out in state: " + ws
.readyState
);
51 var timeoutID
= setTimeout(timeOutCallback
, 3000);