[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

eric at webkit.org eric at webkit.org
Wed Apr 7 23:30:30 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 04a2c0ee725beab2cd1474d0635c70aedfcce1b6
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Nov 11 09:23:18 2009 +0000

    2009-11-11  Yuzo Fujishima  <yuzo at google.com>
    
            Reviewed by David Levin.
    
            Add a test for web socket handshake error.
    
            https://bugs.webkit.org/show_bug.cgi?id=31336
    
            * websocket/tests/handshake-error-expected.txt: Added.
            * websocket/tests/handshake-error.html: Added.
            * websocket/tests/handshake-error_wsh.py: Added.
            * websocket/tests/script-tests/handshake-error.js: Added.
            (endTest):
            (ws.onopen):
            (ws.onmessage):
            (ws.onclose):
            (timeOutCallback):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@50795 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 19ecedc..4039c8a 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -2,6 +2,24 @@
 
         Reviewed by David Levin.
 
+        Add a test for web socket handshake error.
+
+        https://bugs.webkit.org/show_bug.cgi?id=31336
+
+        * websocket/tests/handshake-error-expected.txt: Added.
+        * websocket/tests/handshake-error.html: Added.
+        * websocket/tests/handshake-error_wsh.py: Added.
+        * websocket/tests/script-tests/handshake-error.js: Added.
+        (endTest):
+        (ws.onopen):
+        (ws.onmessage):
+        (ws.onclose):
+        (timeOutCallback):
+
+2009-11-11  Yuzo Fujishima  <yuzo at google.com>
+
+        Reviewed by David Levin.
+
         Add a simple web socket test. This tests basic features of Web Socket.
         This also serves as an example of Web Socket tests.
 
diff --git a/LayoutTests/websocket/tests/handshake-error-expected.txt b/LayoutTests/websocket/tests/handshake-error-expected.txt
new file mode 100644
index 0000000..def9f22
--- /dev/null
+++ b/LayoutTests/websocket/tests/handshake-error-expected.txt
@@ -0,0 +1,9 @@
+Handshake error test
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+Closed.
+PASS ws.readyState is 2
+PASS successfullyParsed is true
+
+TEST COMPLETE
diff --git a/LayoutTests/websocket/tests/handshake-error.html b/LayoutTests/websocket/tests/handshake-error.html
new file mode 100644
index 0000000..fe5c69d
--- /dev/null
+++ b/LayoutTests/websocket/tests/handshake-error.html
@@ -0,0 +1,13 @@
+<!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 src="script-tests/handshake-error.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/websocket/tests/handshake-error_wsh.py b/LayoutTests/websocket/tests/handshake-error_wsh.py
new file mode 100644
index 0000000..dbc707a
--- /dev/null
+++ b/LayoutTests/websocket/tests/handshake-error_wsh.py
@@ -0,0 +1,38 @@
+# Copyright (C) 2009 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
+
+
+def web_socket_do_extra_handshake(request):
+    request.write('ThisWillCauseHandshakeError')
+
+
+def web_socket_transfer_data(request):
+    msgutil.send_message(request, 'Hello from Handshake Error WSH.')
diff --git a/LayoutTests/websocket/tests/script-tests/handshake-error.js b/LayoutTests/websocket/tests/script-tests/handshake-error.js
new file mode 100644
index 0000000..3274104
--- /dev/null
+++ b/LayoutTests/websocket/tests/script-tests/handshake-error.js
@@ -0,0 +1,42 @@
+description("Handshake error test");
+
+if (window.layoutTestController) {
+    layoutTestController.waitUntilDone();
+}
+
+function endTest()
+{
+    isSuccessfullyParsed();
+    if (window.layoutTestController) {
+        layoutTestController.notifyDone();
+    }
+}
+
+var ws = new WebSocket("ws://localhost:8880/websocket/tests/handshake-error");
+
+ws.onopen = function()
+{
+    testFailed("Unexpectedly Connected.");
+};
+
+ws.onmessage = function(messageEvent)
+{
+    testFailed("Unexpectedly Received: '" + messageEvent.data + "'");
+};
+
+ws.onclose = function()
+{
+    debug("Closed.");
+    shouldBe("ws.readyState", "2")
+    endTest();
+};
+
+function timeOutCallback()
+{
+    testFailed("Timed out in state: " + ws.readyState);
+    endTest();
+}
+
+window.setTimeout(timeOutCallback, 3000);
+
+var successfullyParsed = true;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list