4 <meta http-equiv=
"Content-Type" content=
"text/html;charset=UTF-8"></meta>
5 <title>WebSocket test
</title>
6 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
7 <script type=
"text/javascript" src=
"websocket_helpers.js"></script>
8 <script type=
"text/javascript" src=
"websocket_tests.js"></script>
9 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css" />
11 <body onload=
"testWebSocket()">
12 <script class=
"testbody" type=
"text/javascript">
15 test11, // a simple hello echo;
16 test12, // client sends a message containing unpaired surrogates
17 test13, //server sends an invalid message;
18 test14, // server sends the close frame, it doesn't close the tcp connection
19 // and it keeps sending normal ws messages;
20 test15, // server closes the tcp connection, but it doesn't send the close
22 test16, // client calls close() and tries to send a message;
23 test17, // see bug
572975 - all event listeners set
24 test18, // client tries to connect to an http resource;
25 test19, // server closes the tcp connection before establishing the ws
27 test20, // see bug
572975 - only on error and onclose event listeners set
30 function testWebSocket() {
34 SimpleTest.requestFlakyTimeout(
"The web socket tests are really fragile, but avoiding timeouts might be hard, since it's testing stuff on the network. " +
35 "Expect all sorts of flakiness in this test...");
36 SimpleTest.waitForExplicitFinish();