Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(410)

Unified Diff: LayoutTests/http/tests/websocket/tests/hybi/close-on-unload.html

Issue 23069004: Check WebSocket close code sent on unload (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updating the code comments for landing Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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>

Powered by Google App Engine
This is Rietveld 408576698