| Index: LayoutTests/http/tests/websocket/tests/hybi/close-on-unload.html
|
| diff --git a/LayoutTests/http/tests/websocket/tests/hybi/close-on-unload.html b/LayoutTests/http/tests/websocket/tests/hybi/close-on-unload.html
|
| index e05ddae388bda03272756370253d8ec79dcfc078..7a0ce17f711837f8b542c7c02f485dcf728c87ca 100644
|
| --- a/LayoutTests/http/tests/websocket/tests/hybi/close-on-unload.html
|
| +++ b/LayoutTests/http/tests/websocket/tests/hybi/close-on-unload.html
|
| @@ -13,6 +13,7 @@ window.jsTestIsAsync = true;
|
|
|
| var frameDiv;
|
| var closedSocket;
|
| +var closeCode;
|
|
|
| var ws = new WebSocket("ws://127.0.0.1:8880/websocket/tests/hybi/close-on-unload");
|
| ws.onopen = function()
|
| @@ -25,12 +26,15 @@ ws.onopen = function()
|
| };
|
| ws.onmessage = function(evt)
|
| {
|
| - closedSocket = evt.data;
|
| + var messageData = JSON.parse(evt.data);
|
| + closedSocket = messageData.message;
|
| + closeCode = messageData.closeCode;
|
| ws.close();
|
| };
|
| ws.onclose = function()
|
| {
|
| shouldBe("closedSocket", '"socket1"');
|
| + shouldBe("closeCode", '"1001"');
|
| finishJSTest();
|
| };
|
|
|
| @@ -38,7 +42,7 @@ document.iframeReady = function()
|
| {
|
| debug("PASS 'socket1' is sent to the server. unload the iframe. expect receiving 'socket1' on ws...");
|
| document.body.removeChild(frameDiv);
|
| -};
|
| +};
|
|
|
| </script>
|
| <script src="/js-test-resources/js-test-post.js"></script>
|
|
|