Commit a0e9d270 authored by ukai@chromium.org's avatar ukai@chromium.org

2010-02-03 Fumitoshi Ukai <ukai@chromium.org>

        Reviewed by Alexey Proskuryakov.

        navigating a frame to new location closes websocket in the frame
        https://bugs.webkit.org/show_bug.cgi?id=34557

        * websocket/tests/close-on-navigate-new-location-expected.txt: Added.
        * websocket/tests/close-on-navigate-new-location.html: Added.

git-svn-id: svn://svn.chromium.org/blink/trunk@54324 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 13acb464
2010-02-03 Fumitoshi Ukai <ukai@chromium.org>
Reviewed by Alexey Proskuryakov.
navigating a frame to new location closes websocket in the frame
https://bugs.webkit.org/show_bug.cgi?id=34557
* websocket/tests/close-on-navigate-new-location-expected.txt: Added.
* websocket/tests/close-on-navigate-new-location.html: Added.
2010-02-03 Brady Eidson <beidson@apple.com> 2010-02-03 Brady Eidson <beidson@apple.com>
Reviewed by Alexey Proskuryakov. Reviewed by Alexey Proskuryakov.
......
Test if Web Socket is closed when navigating to new location.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS ws on master document is ready.
PASS insert a iframe, where open ws called 'socket1'
PASS 'socket1' is sent to the server. navigate to new location. expect receiving 'socket1' on ws...
PASS closedSocket is "socket1"
PASS successfullyParsed is true
TEST COMPLETE
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<link rel="stylesheet" href="../../fast/js/resources/js-test-style.css">
<script src="../../fast/js/resources/js-test-pre.js"></script>
<script src="../../fast/js/resources/js-test-post-function.js"></script>
</head>
<body>
<div id="description"></div>
<div id="console"></div>
<script type="text/javascript">
description("Test if Web Socket is closed when navigating to new location.");
if (window.layoutTestController)
layoutTestController.waitUntilDone();
var frameDiv;
var closedSocket;
function endTest()
{
shouldBe("closedSocket", '"socket1"');
isSuccessfullyParsed();
if (window.layoutTestController)
layoutTestController.notifyDone();
};
var ws = new WebSocket("ws://127.0.0.1:8880/websocket/tests/close-on-unload");
ws.onopen = function()
{
debug("PASS ws on master document is ready.");
frameDiv = document.createElement("iframe");
frameDiv.src = "resources/close-on-unload-iframe.html";
document.body.appendChild(frameDiv);
debug("PASS insert a iframe, where open ws called 'socket1'");
};
ws.onmessage = function(evt)
{
closedSocket = evt.data;
ws.close();
};
ws.onclose = function()
{
endTest();
};
document.iframeReady = function()
{
debug("PASS 'socket1' is sent to the server. navigate to new location. expect receiving 'socket1' on ws...");
frameDiv.src = "handler_map.txt";
};
var successfullyParsed = true;
</script>
</body>
</html>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment