4 <script src=
"/js-test-resources/js-test.js"></script>
7 <div id=
"description"></div>
8 <div id=
"console"></div>
10 description("Test that readyState is CLOSED within onerror event");
11 window
.jsTestIsAsync
= true;
17 debug("Test start (Port 8880)");
19 // This URL must return a 404 error.
20 var url
= "ws://127.0.0.1:8880/non-existent-url"
22 ws
= new WebSocket(url
);
24 ws
.onopen = function()
26 testFailed("Connected");
30 ws
.onerror = function()
32 shouldBe("ws.readyState", "3");
35 ws
.onclose = function()