4 <script src=
"/js-test-resources/js-test.js"></script>
7 <div id=
"description"></div>
8 <div id=
"console"></div>
10 description('Connection should fail immediately if the server returns a 404 error.');
12 window
.jsTestIsAsync
= true;
14 var url
= 'ws://localhost:8880/handshake-fail-by-404';
15 var ws
= new WebSocket(url
);
19 ws
.onopen = function()
21 testFailed('onopen called');
25 ws
.onclose = function(event
)
27 wasClean
= event
.wasClean
;
28 shouldBeFalse('wasClean');
32 ws
.onerror = function(errorEvent
)
34 testPassed("onerror() was called");