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

ukai at chromium.org ukai at chromium.org
Thu Apr 8 00:28:46 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 321d76045fe5bda77cabb32873d7cdc28061bb72
Author: ukai at chromium.org <ukai at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Dec 9 03:39:13 2009 +0000

    2009-12-08  Fumitoshi Ukai  <ukai at chromium.org>
    
            Reviewed by Darin Adler.
    
            WebSocket allow space (U+0020) in sub protocol name.
            https://bugs.webkit.org/show_bug.cgi?id=32266
    
            Skipped sub-protocol-with-space.html for now until new pywebsocket is
            landed.
    
            * websocket/tests/bad-sub-protocol-expected.txt:
            * websocket/tests/script-tests/bad-sub-protocol.js:
            * websocket/tests/script-tests/sub-protocol-with-space.js: Added.
            * websocket/tests/sub-protocol-with-space-expected.txt: Added.
            * websocket/tests/sub-protocol-with-space.html: Added.
    2009-12-08  Fumitoshi Ukai  <ukai at chromium.org>
    
            Reviewed by Darin Adler.
    
            WebSocket allow space (U+0020) in sub protocol name.
            https://bugs.webkit.org/show_bug.cgi?id=32266
    
            Test: websocket/tests/sub-protocol-with-space.html
    
            * websockets/WebSocket.cpp:
            (WebCore::isValidProtocolString):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51886 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 42592a3..a362dbb 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -2,6 +2,22 @@
 
         Reviewed by Darin Adler.
 
+        WebSocket allow space (U+0020) in sub protocol name.
+        https://bugs.webkit.org/show_bug.cgi?id=32266
+
+        Skipped sub-protocol-with-space.html for now until new pywebsocket is
+        landed.
+
+        * websocket/tests/bad-sub-protocol-expected.txt:
+        * websocket/tests/script-tests/bad-sub-protocol.js:
+        * websocket/tests/script-tests/sub-protocol-with-space.js: Added.
+        * websocket/tests/sub-protocol-with-space-expected.txt: Added.
+        * websocket/tests/sub-protocol-with-space.html: Added.
+
+2009-12-08  Fumitoshi Ukai  <ukai at chromium.org>
+
+        Reviewed by Darin Adler.
+
         Add tests that WebSocket-Protocol: is ignored if protocol was not specified.
         https://bugs.webkit.org/show_bug.cgi?id=32267
 
diff --git a/LayoutTests/platform/mac/Skipped b/LayoutTests/platform/mac/Skipped
index afd9179..e6517ad 100644
--- a/LayoutTests/platform/mac/Skipped
+++ b/LayoutTests/platform/mac/Skipped
@@ -111,3 +111,6 @@ plugins/qt-qwidget-plugin.html
 
 # This test requires ogg codecs
 media/media-can-play-ogg.html
+
+# This test requires new pywebsocket
+websocket/tests/sub-protocol-with-space.html
diff --git a/LayoutTests/platform/win/Skipped b/LayoutTests/platform/win/Skipped
index 2a56bb8..99838b3 100644
--- a/LayoutTests/platform/win/Skipped
+++ b/LayoutTests/platform/win/Skipped
@@ -724,3 +724,6 @@ fast/js/excessive-comma-usage.html
 fast/js/math-transforms.html
 fast/js/math.html
 fast/js/lastModified.html
+
+# This test requires new pywebsocket
+websocket/tests/sub-protocol-with-space.html
diff --git a/LayoutTests/websocket/tests/bad-sub-protocol-expected.txt b/LayoutTests/websocket/tests/bad-sub-protocol-expected.txt
index 8574acf..0c2fcde 100644
--- a/LayoutTests/websocket/tests/bad-sub-protocol-expected.txt
+++ b/LayoutTests/websocket/tests/bad-sub-protocol-expected.txt
@@ -3,7 +3,6 @@ Test WebSocket bad sub-protocol names.
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 PASS new WebSocket("ws://127.0.0.1:8880/simple", "") threw exception Error: SYNTAX_ERR: DOM Exception 12.
-PASS new WebSocket("ws://127.0.0.1:8880/simple", "sub protocol") threw exception Error: SYNTAX_ERR: DOM Exception 12.
 PASS new WebSocket("ws://127.0.0.1:8880/simple", "") threw exception Error: SYNTAX_ERR: DOM Exception 12.
 PASS new WebSocket("ws://127.0.0.1:8880/simple", "	") threw exception Error: SYNTAX_ERR: DOM Exception 12.
 PASS new WebSocket("ws://127.0.0.1:8880/simple", "
@@ -11,6 +10,7 @@ PASS new WebSocket("ws://127.0.0.1:8880/simple", "
 PASS new WebSocket("ws://127.0.0.1:8880/simple", "
 ") threw exception SyntaxError: Parse error.
 PASS new WebSocket("ws://127.0.0.1:8880/simple", "") threw exception Error: SYNTAX_ERR: DOM Exception 12.
+PASS new WebSocket("ws://127.0.0.1:8880/simple", "") threw exception Error: SYNTAX_ERR: DOM Exception 12.
 PASS new WebSocket("ws://127.0.0.1:8880/simple", "€") threw exception Error: SYNTAX_ERR: DOM Exception 12.
 PASS new WebSocket("ws://127.0.0.1:8880/simple", "あ") threw exception Error: SYNTAX_ERR: DOM Exception 12.
 PASS new WebSocket("ws://127.0.0.1:8880/simple", "￿") threw exception Error: SYNTAX_ERR: DOM Exception 12.
diff --git a/LayoutTests/websocket/tests/script-tests/bad-sub-protocol.js b/LayoutTests/websocket/tests/script-tests/bad-sub-protocol.js
index 1d8d486..66f8b38 100644
--- a/LayoutTests/websocket/tests/script-tests/bad-sub-protocol.js
+++ b/LayoutTests/websocket/tests/script-tests/bad-sub-protocol.js
@@ -3,15 +3,15 @@ description("Test WebSocket bad sub-protocol names.");
 // Fails if protocol is an empty string.
 shouldThrow('new WebSocket("ws://127.0.0.1:8880/simple", "")');
 
-// Fails if protocol contains an character less than U+0021.
-shouldThrow('new WebSocket("ws://127.0.0.1:8880/simple", "sub protocol")');
+// Fails if protocol contains an character less than U+0020.
 shouldThrow('new WebSocket("ws://127.0.0.1:8880/simple", "\u0000")');
 shouldThrow('new WebSocket("ws://127.0.0.1:8880/simple", "\u0009")');
 shouldThrow('new WebSocket("ws://127.0.0.1:8880/simple", "\u000A")');
 shouldThrow('new WebSocket("ws://127.0.0.1:8880/simple", "\u000D")');
 shouldThrow('new WebSocket("ws://127.0.0.1:8880/simple", "\u001B")');
 
-// Fails if protocol containns an character greater than U+007F.
+// Fails if protocol contains an character greater than U+007E.
+shouldThrow('new WebSocket("ws://127.0.0.1:8880/simple", "\u007F")');
 shouldThrow('new WebSocket("ws://127.0.0.1:8880/simple", "\u0080")');
 shouldThrow('new WebSocket("ws://127.0.0.1:8880/simple", "\u3042")');
 shouldThrow('new WebSocket("ws://127.0.0.1:8880/simple", "\uFFFF")');
diff --git a/LayoutTests/websocket/tests/script-tests/sub-protocol-with-space.js b/LayoutTests/websocket/tests/script-tests/sub-protocol-with-space.js
new file mode 100644
index 0000000..9fb411a
--- /dev/null
+++ b/LayoutTests/websocket/tests/script-tests/sub-protocol-with-space.js
@@ -0,0 +1,44 @@
+description("Test WebSocket handshake success with sub protocol contains space.");
+
+if (window.layoutTestController)
+    layoutTestController.waitUntilDone();
+
+var protocol;
+
+function endTest()
+{
+    shouldBe("protocol", '"sub protocol"');
+    clearTimeout(timeoutID);
+    isSuccessfullyParsed();
+    if (window.layoutTestController)
+        layoutTestController.notifyDone();
+}
+
+var url = "ws://localhost:8880/websocket/tests/protocol-test?protocol=sub%20protocol";
+var ws = new WebSocket(url, "sub protocol");
+
+ws.onopen = function()
+{
+    debug("Connected");
+};
+
+ws.onmessage = function (messageEvent)
+{
+    protocol = messageEvent.data;
+    ws.close();
+};
+
+ws.onclose = function()
+{
+    endTest();
+};
+
+function timeOutCallback()
+{
+    debug("Timed out in state: " + ws.readyState);
+    endTest();
+}
+
+var timeoutID = setTimeout(timeOutCallback, 3000);
+
+var successfullyParsed = true;
diff --git a/LayoutTests/websocket/tests/sub-protocol-with-space-expected.txt b/LayoutTests/websocket/tests/sub-protocol-with-space-expected.txt
new file mode 100644
index 0000000..021a749
--- /dev/null
+++ b/LayoutTests/websocket/tests/sub-protocol-with-space-expected.txt
@@ -0,0 +1,10 @@
+Test WebSocket handshake success with sub protocol contains space.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+Connected
+PASS protocol is "sub protocol"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/websocket/tests/sub-protocol-with-space.html b/LayoutTests/websocket/tests/sub-protocol-with-space.html
new file mode 100644
index 0000000..7973549
--- /dev/null
+++ b/LayoutTests/websocket/tests/sub-protocol-with-space.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/sub-protocol-with-space.js"></script>
+</body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index dcd46fc..2937020 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,15 @@
+2009-12-08  Fumitoshi Ukai  <ukai at chromium.org>
+
+        Reviewed by Darin Adler.
+
+        WebSocket allow space (U+0020) in sub protocol name.
+        https://bugs.webkit.org/show_bug.cgi?id=32266
+
+        Test: websocket/tests/sub-protocol-with-space.html
+
+        * websockets/WebSocket.cpp:
+        (WebCore::isValidProtocolString):
+
 2009-12-08  Peterson Trethewey  <petersont at google.com>
 
         Reviewed by Oliver Hunt.
diff --git a/WebCore/websockets/WebSocket.cpp b/WebCore/websockets/WebSocket.cpp
index 7d16493..2b54091 100644
--- a/WebCore/websockets/WebSocket.cpp
+++ b/WebCore/websockets/WebSocket.cpp
@@ -79,7 +79,7 @@ static bool isValidProtocolString(const WebCore::String& protocol)
         return false;
     const UChar* characters = protocol.characters();
     for (size_t i = 0; i < protocol.length(); i++) {
-        if (characters[i] < 0x21 || characters[i] > 0x7E)
+        if (characters[i] < 0x20 || characters[i] > 0x7E)
             return false;
     }
     return true;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list