[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.21-584-g1e41756

ukai at chromium.org ukai at chromium.org
Fri Feb 26 22:18:18 UTC 2010


The following commit has been merged in the webkit-1.1 branch:
commit f30cd2302d3bca01e2d288e1e622664a02263681
Author: ukai at chromium.org <ukai at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Feb 12 01:48:52 2010 +0000

    2010-02-11  Fumitoshi Ukai  <ukai at chromium.org>
    
            Reviewed by Alexey Proskuryakov.
    
            WebSocket in Worker failed to close
            https://bugs.webkit.org/show_bug.cgi?id=34785
    
            * websocket/tests/workers/close-in-shared-worker-expected.txt: Added.
            * websocket/tests/workers/close-in-shared-worker.html: Added.
            * websocket/tests/workers/close-in-worker-expected.txt: Added.
            * websocket/tests/workers/close-in-worker.html: Added.
            * websocket/tests/workers/resources/close-in-worker.js: Added.
            * websocket/tests/workers/resources/echo_wsh.py: Copied from LayoutTests/websocket/tests/echo_wsh.py.
    2010-02-11  Fumitoshi Ukai  <ukai at chromium.org>
    
            Reviewed by Alexey Proskuryakov.
    
            WebSocket in Worker failed to close
            https://bugs.webkit.org/show_bug.cgi?id=34785
    
            Tests: websocket/tests/workers/close-in-shared-worker.html
                   websocket/tests/workers/close-in-worker.html
    
            * websockets/WorkerThreadableWebSocketChannel.cpp:
            (WebCore::WorkerThreadableWebSocketChannel::close):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@54692 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index cd41d05..aeaba99 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,17 @@
+2010-02-11  Fumitoshi Ukai  <ukai at chromium.org>
+
+        Reviewed by Alexey Proskuryakov.
+
+        WebSocket in Worker failed to close
+        https://bugs.webkit.org/show_bug.cgi?id=34785
+
+        * websocket/tests/workers/close-in-shared-worker-expected.txt: Added.
+        * websocket/tests/workers/close-in-shared-worker.html: Added.
+        * websocket/tests/workers/close-in-worker-expected.txt: Added.
+        * websocket/tests/workers/close-in-worker.html: Added.
+        * websocket/tests/workers/resources/close-in-worker.js: Added.
+        * websocket/tests/workers/resources/echo_wsh.py: Copied from LayoutTests/websocket/tests/echo_wsh.py.
+
 2010-02-11  Nikolas Zimmermann  <nzimmermann at rim.com>
 
         Not reviewed. Oops, move mac-lepard results for mask-invalidation.svg into the correct folder.
diff --git a/LayoutTests/websocket/tests/workers/close-in-shared-worker-expected.txt b/LayoutTests/websocket/tests/workers/close-in-shared-worker-expected.txt
new file mode 100644
index 0000000..1ac33ee
--- /dev/null
+++ b/LayoutTests/websocket/tests/workers/close-in-shared-worker-expected.txt
@@ -0,0 +1,12 @@
+Test for Web Socket close in SharedWorker.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+PASS: worker: init
+PASS: worker: WebSocket exists
+PASS: worker: successfullyParsed:[object WebSocket]
+PASS: worker: Connected.
+PASS: worker: Closed.
+DONE
+TEST COMPLETE
+
diff --git a/LayoutTests/websocket/tests/workers/close-in-shared-worker.html b/LayoutTests/websocket/tests/workers/close-in-shared-worker.html
new file mode 100644
index 0000000..91b77d4
--- /dev/null
+++ b/LayoutTests/websocket/tests/workers/close-in-shared-worker.html
@@ -0,0 +1,35 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head></head>
+<body>
+<p>Test for Web Socket close in SharedWorker.</p>
+<p></p>
+<p>On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".</p>
+<pre id=log>
+</pre>
+<script>
+if (window.layoutTestController) {
+    layoutTestController.dumpAsText();
+    layoutTestController.waitUntilDone();
+}
+
+function log(message)
+{
+    document.getElementById("log").innerHTML += message + "\n";
+}
+
+function endTest()
+{
+    log("TEST COMPLETE");
+    if (window.layoutTestController)
+        layoutTestController.notifyDone();
+}
+var worker = new SharedWorker('resources/close-in-worker.js', 'websocketCloseInWorker');
+worker.port.onmessage = function (evt) {
+    log(evt.data);
+    if (evt.data == "DONE")
+        endTest();
+};
+</script>
+</body>
+</html>
diff --git a/LayoutTests/websocket/tests/workers/close-in-worker-expected.txt b/LayoutTests/websocket/tests/workers/close-in-worker-expected.txt
new file mode 100644
index 0000000..7b9f905
--- /dev/null
+++ b/LayoutTests/websocket/tests/workers/close-in-worker-expected.txt
@@ -0,0 +1,12 @@
+Test for Web Socket close in Worker.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+PASS: worker: init
+PASS: worker: WebSocket exists
+PASS: worker: successfullyParsed:[object WebSocket]
+PASS: worker: Connected.
+PASS: worker: Closed.
+DONE
+TEST COMPLETE
+
diff --git a/LayoutTests/websocket/tests/workers/close-in-worker.html b/LayoutTests/websocket/tests/workers/close-in-worker.html
new file mode 100644
index 0000000..7c631d2
--- /dev/null
+++ b/LayoutTests/websocket/tests/workers/close-in-worker.html
@@ -0,0 +1,35 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head></head>
+<body>
+<p>Test for Web Socket close in Worker.</p>
+<p></p>
+<p>On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".</p>
+<pre id=log>
+</pre>
+<script>
+if (window.layoutTestController) {
+    layoutTestController.dumpAsText();
+    layoutTestController.waitUntilDone();
+}
+
+function log(message)
+{
+    document.getElementById("log").innerHTML += message + "\n";
+}
+
+function endTest()
+{
+    log("TEST COMPLETE");
+    if (window.layoutTestController)
+        layoutTestController.notifyDone();
+}
+var worker = new Worker('resources/close-in-worker.js');
+worker.onmessage = function (evt) {
+    log(evt.data);
+    if (evt.data == "DONE")
+        endTest();
+};
+</script>
+</body>
+</html>
diff --git a/LayoutTests/websocket/tests/workers/resources/close-in-worker.js b/LayoutTests/websocket/tests/workers/resources/close-in-worker.js
new file mode 100644
index 0000000..4e68085
--- /dev/null
+++ b/LayoutTests/websocket/tests/workers/resources/close-in-worker.js
@@ -0,0 +1,36 @@
+if (self.postMessage)
+    runTests();
+else
+    onconnect = handleConnect;
+
+function handleConnect(event)
+{
+    // For shared workers, create a faux postMessage() API to send message back to the parent page.
+    self.postMessage = function (message) { event.ports[0].postMessage(message); };
+    runTests();
+};
+
+function runTests()
+{
+    var ws;
+    try {
+        postMessage("PASS: worker: init");
+        if ('WebSocket' in self)
+            postMessage("PASS: worker: WebSocket exists");
+        else
+            postMessage("FAIL: worker: no WebSocket");
+        ws = new WebSocket('ws://localhost:8880/websocket/tests/workers/resources/echo');
+        ws.onopen = function() {
+            postMessage("PASS: worker: Connected.");
+            ws.close();
+        };
+        ws.onclose = function() {
+            postMessage("PASS: worker: Closed.");
+            postMessage("DONE");
+        };
+    } catch (e) {
+        postMessage("FAIL: worker: Unexpected exception: " + e);
+    } finally {
+        postMessage("PASS: worker: successfullyParsed:" + ws);
+    }
+};
diff --git a/LayoutTests/websocket/tests/workers/resources/echo_wsh.py b/LayoutTests/websocket/tests/workers/resources/echo_wsh.py
new file mode 100644
index 0000000..429f581
--- /dev/null
+++ b/LayoutTests/websocket/tests/workers/resources/echo_wsh.py
@@ -0,0 +1,46 @@
+# Copyright 2010, Google Inc.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions are
+# met:
+#
+#     * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#     * Redistributions in binary form must reproduce the above
+# copyright notice, this list of conditions and the following disclaimer
+# in the documentation and/or other materials provided with the
+# distribution.
+#     * Neither the name of Google Inc. nor the names of its
+# contributors may be used to endorse or promote products derived from
+# this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+from mod_pywebsocket import msgutil
+
+
+_GOODBYE_MESSAGE = 'Goodbye'
+
+
+def web_socket_do_extra_handshake(request):
+    pass  # Always accept.
+
+
+def web_socket_transfer_data(request):
+    while True:
+        line = msgutil.receive_message(request)
+        msgutil.send_message(request, line)
+        if line == _GOODBYE_MESSAGE:
+            return
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 790c1c4..5aee487 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2010-02-11  Fumitoshi Ukai  <ukai at chromium.org>
+
+        Reviewed by Alexey Proskuryakov.
+
+        WebSocket in Worker failed to close
+        https://bugs.webkit.org/show_bug.cgi?id=34785
+
+        Tests: websocket/tests/workers/close-in-shared-worker.html
+               websocket/tests/workers/close-in-worker.html
+
+        * websockets/WorkerThreadableWebSocketChannel.cpp:
+        (WebCore::WorkerThreadableWebSocketChannel::close):
+
 2010-02-11  Kwang Yul Seo  <skyul at company100.net>
 
         Reviewed by Eric Seidel.
diff --git a/WebCore/websockets/WorkerThreadableWebSocketChannel.cpp b/WebCore/websockets/WorkerThreadableWebSocketChannel.cpp
index 8db81b7..dac1f19 100644
--- a/WebCore/websockets/WorkerThreadableWebSocketChannel.cpp
+++ b/WebCore/websockets/WorkerThreadableWebSocketChannel.cpp
@@ -84,7 +84,7 @@ unsigned long WorkerThreadableWebSocketChannel::bufferedAmount() const
 
 void WorkerThreadableWebSocketChannel::close()
 {
-    if (!m_bridge)
+    if (m_bridge)
         m_bridge->close();
 }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list