Skip to content
Permalink
Browse files
2011-05-24 Fumitoshi Ukai <ukai@chromium.org>
        Reviewed by Adam Barth.

        close before open WebSocket doesn't fire close event.
        https://bugs.webkit.org/show_bug.cgi?id=57301

        * http/tests/websocket/tests/close-before-open-expected.txt: Added.
        * http/tests/websocket/tests/close-before-open.html: Added.
2011-05-24  Fumitoshi Ukai  <ukai@chromium.org>

        Reviewed by Adam Barth.

        close before open WebSocket doesn't fire close event.
        https://bugs.webkit.org/show_bug.cgi?id=57301

        In platformClose(), m_readStream may be 0 until proxy is resolved.
        It should callback didClose() in such case.

        Test: http/tests/websocket/tests/close-before-open.html

        * platform/network/cf/SocketStreamHandleCFNet.cpp:
        (WebCore::SocketStreamHandle::platformClose):

Canonical link: https://commits.webkit.org/76715@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@87135 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Fumitoshi Ukai committed May 24, 2011
1 parent ce4e28d commit 597f0154e628d9ab2a5d8499c3ba68244b473a8d
@@ -1,3 +1,13 @@
2011-05-24 Fumitoshi Ukai <ukai@chromium.org>

Reviewed by Adam Barth.

close before open WebSocket doesn't fire close event.
https://bugs.webkit.org/show_bug.cgi?id=57301

* http/tests/websocket/tests/close-before-open-expected.txt: Added.
* http/tests/websocket/tests/close-before-open.html: Added.

2011-05-24 Zoltan Horvath <zoltan@webkit.org>

[Qt][WK2] Paint the bot green for ultimate satisfaction of Ossy.
@@ -0,0 +1,9 @@
Test if Web Socket fires close event when WebSocket is opened and closed fore open event is received.

On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".

closed
PASS successfullyParsed is true

TEST COMPLETE

@@ -0,0 +1,29 @@
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html>
<head>
<link rel="stylesheet" href="../../../js-test-resources/js-test-style.css">
<script src="../../../js-test-resources/js-test-pre.js"></script>
<script src="../../../js-test-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 fires close event when WebSocket is opened and closed fore open event is received.");

if (window.layoutTestController)
layoutTestController.waitUntilDone();

var ws = new WebSocket("ws://127.0.0.1:8880/websocket/tests/hanging-handshake");
ws.onclose = function() {
debug("closed");
isSuccessfullyParsed();
if (window.layoutTestController)
layoutTestController.notifyDone();
};
var successfullyParsed = true;
ws.close();
</script>

</body>
</html>
@@ -1,3 +1,18 @@
2011-05-24 Fumitoshi Ukai <ukai@chromium.org>

Reviewed by Adam Barth.

close before open WebSocket doesn't fire close event.
https://bugs.webkit.org/show_bug.cgi?id=57301

In platformClose(), m_readStream may be 0 until proxy is resolved.
It should callback didClose() in such case.

Test: http/tests/websocket/tests/close-before-open.html

* platform/network/cf/SocketStreamHandleCFNet.cpp:
(WebCore::SocketStreamHandle::platformClose):

2011-05-23 Sheriff Bot <webkit.review.bot@gmail.com>

Unreviewed, rolling out r87118.
@@ -569,8 +569,11 @@ void SocketStreamHandle::platformClose()
removePACRunLoopSource();

ASSERT(!m_readStream == !m_writeStream);
if (!m_readStream)
if (!m_readStream) {
if (m_connectingSubstate == New || m_connectingSubstate == ExecutingPACFile)
m_client->didClose(this);
return;
}

#if PLATFORM(WIN)
CFReadStreamUnscheduleFromRunLoop(m_readStream.get(), loaderRunLoop(), kCFRunLoopDefaultMode);

0 comments on commit 597f015

Please sign in to comment.