Title: [109941] trunk
Revision
109941
Author
[email protected]
Date
2012-03-06 11:50:48 -0800 (Tue, 06 Mar 2012)

Log Message

Unreviewed, rolling out r109840.
http://trac.webkit.org/changeset/109840
https://bugs.webkit.org/show_bug.cgi?id=80103

Broke WebSocket tests on Chrome Mac and Linux

Source/WebCore: 

* Modules/websockets/WebSocket.cpp:
(WebCore::WebSocket::send):
(WebCore::WebSocket::close):
* Modules/websockets/WebSocketChannel.cpp:
(WebCore::WebSocketChannel::send):

LayoutTests: 

* http/tests/websocket/tests/hybi/close-expected.txt:
* http/tests/websocket/tests/hybi/unpaired-surrogates-in-close-reason-expected.txt: Removed.
* http/tests/websocket/tests/hybi/unpaired-surrogates-in-close-reason.html: Removed.
* http/tests/websocket/tests/hybi/unpaired-surrogates-in-message-expected.txt: Removed.
* http/tests/websocket/tests/hybi/unpaired-surrogates-in-message.html: Removed.
* http/tests/websocket/tests/hybi/workers/close-expected.txt:

Modified Paths

Removed Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (109940 => 109941)


--- trunk/LayoutTests/ChangeLog	2012-03-06 19:44:53 UTC (rev 109940)
+++ trunk/LayoutTests/ChangeLog	2012-03-06 19:50:48 UTC (rev 109941)
@@ -1,3 +1,18 @@
+2012-03-06  Stephen White  <[email protected]>
+
+        Unreviewed, rolling out r109840.
+        http://trac.webkit.org/changeset/109840
+        https://bugs.webkit.org/show_bug.cgi?id=80103
+
+        Broke WebSocket tests on Chrome Mac and Linux
+
+        * http/tests/websocket/tests/hybi/close-expected.txt:
+        * http/tests/websocket/tests/hybi/unpaired-surrogates-in-close-reason-expected.txt: Removed.
+        * http/tests/websocket/tests/hybi/unpaired-surrogates-in-close-reason.html: Removed.
+        * http/tests/websocket/tests/hybi/unpaired-surrogates-in-message-expected.txt: Removed.
+        * http/tests/websocket/tests/hybi/unpaired-surrogates-in-message.html: Removed.
+        * http/tests/websocket/tests/hybi/workers/close-expected.txt:
+
 2012-03-06  Hans Wennborg  <[email protected]>
 
         Speech _javascript_ API: add SpeechRecognitionError

Modified: trunk/LayoutTests/http/tests/websocket/tests/hybi/close-expected.txt (109940 => 109941)


--- trunk/LayoutTests/http/tests/websocket/tests/hybi/close-expected.txt	2012-03-06 19:44:53 UTC (rev 109940)
+++ trunk/LayoutTests/http/tests/websocket/tests/hybi/close-expected.txt	2012-03-06 19:50:48 UTC (rev 109941)
@@ -1,6 +1,4 @@
 CONSOLE MESSAGE: WebSocket is closed before the connection is established.
-CONSOLE MESSAGE: WebSocket close message is too long.
-CONSOLE MESSAGE: WebSocket close message is too long.
 CONSOLE MESSAGE: WebSocket is closed before the connection is established.
 Verify WebSocket::close behaviors.
 

Deleted: trunk/LayoutTests/http/tests/websocket/tests/hybi/unpaired-surrogates-in-close-reason-expected.txt (109940 => 109941)


--- trunk/LayoutTests/http/tests/websocket/tests/hybi/unpaired-surrogates-in-close-reason-expected.txt	2012-03-06 19:44:53 UTC (rev 109940)
+++ trunk/LayoutTests/http/tests/websocket/tests/hybi/unpaired-surrogates-in-close-reason-expected.txt	2012-03-06 19:50:48 UTC (rev 109941)
@@ -1,11 +0,0 @@
-CONSOLE MESSAGE: WebSocket close message contains invalid character(s).
-Checks whether SYNTAX_ERR is thrown when attemping to close the connection with unpaired surrogates.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-Connected.
-PASS ws.close(1000, '\x{D807}'); threw exception Error: SYNTAX_ERR: DOM Exception 12.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-

Deleted: trunk/LayoutTests/http/tests/websocket/tests/hybi/unpaired-surrogates-in-close-reason.html (109940 => 109941)


--- trunk/LayoutTests/http/tests/websocket/tests/hybi/unpaired-surrogates-in-close-reason.html	2012-03-06 19:44:53 UTC (rev 109940)
+++ trunk/LayoutTests/http/tests/websocket/tests/hybi/unpaired-surrogates-in-close-reason.html	2012-03-06 19:50:48 UTC (rev 109941)
@@ -1,39 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-<head>
-<script src=""
-</head>
-<body>
-<div id="description"></div>
-<div id="console"></div>
-<script type="text/_javascript_">
-description("Checks whether SYNTAX_ERR is thrown when attemping to close the connection with unpaired surrogates.");
-
-window.jsTestIsAsync = true;
-if (window.layoutTestController)
-    layoutTestController.overridePreference("WebKitHixie76WebSocketProtocolEnabled", 0);
-
-var ws = new WebSocket("ws://localhost:8880/websocket/tests/hybi/echo");
-
-ws._onopen_ = function()
-{
-    debug("Connected.");
-    shouldThrow("ws.close(1000, '\uD807');");
-    ws.close();
-};
-
-ws._onmessage_ = function (event)
-{
-    var message = event.data;
-    testFailed("onmessage() was called. (message = \"" + message + "\")");
-};
-
-ws._onclose_ = function()
-{
-    finishJSTest();
-};
-
-</script>
-<script src=""
-</body>
-</html>

Deleted: trunk/LayoutTests/http/tests/websocket/tests/hybi/unpaired-surrogates-in-message-expected.txt (109940 => 109941)


--- trunk/LayoutTests/http/tests/websocket/tests/hybi/unpaired-surrogates-in-message-expected.txt	2012-03-06 19:44:53 UTC (rev 109940)
+++ trunk/LayoutTests/http/tests/websocket/tests/hybi/unpaired-surrogates-in-message-expected.txt	2012-03-06 19:50:48 UTC (rev 109941)
@@ -1,11 +0,0 @@
-CONSOLE MESSAGE: Websocket message contains invalid character(s).
-Checks whether SYNTAX_ERR is thrown when attemping to send unpaired surrogates.
-
-On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
-
-Connected.
-PASS ws.send('\x{D807}'); threw exception Error: SYNTAX_ERR: DOM Exception 12.
-PASS successfullyParsed is true
-
-TEST COMPLETE
-

Deleted: trunk/LayoutTests/http/tests/websocket/tests/hybi/unpaired-surrogates-in-message.html (109940 => 109941)


--- trunk/LayoutTests/http/tests/websocket/tests/hybi/unpaired-surrogates-in-message.html	2012-03-06 19:44:53 UTC (rev 109940)
+++ trunk/LayoutTests/http/tests/websocket/tests/hybi/unpaired-surrogates-in-message.html	2012-03-06 19:50:48 UTC (rev 109941)
@@ -1,40 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
-<html>
-<head>
-<script src=""
-</head>
-<body>
-<div id="description"></div>
-<div id="console"></div>
-<script type="text/_javascript_">
-description("Checks whether SYNTAX_ERR is thrown when attemping to send unpaired surrogates.");
-
-window.jsTestIsAsync = true;
-if (window.layoutTestController)
-    layoutTestController.overridePreference("WebKitHixie76WebSocketProtocolEnabled", 0);
-
-var ws = new WebSocket("ws://localhost:8880/websocket/tests/hybi/echo");
-
-ws._onopen_ = function()
-{
-    debug("Connected.");
-    shouldThrow("ws.send('\uD807');");
-    ws.close();
-};
-
-ws._onmessage_ = function (event)
-{
-    var message = event.data;
-    testFailed("onmessage() was called. (message = \"" + message + "\")");
-    ws.close();
-};
-
-ws._onclose_ = function()
-{
-    finishJSTest();
-};
-
-</script>
-<script src=""
-</body>
-</html>

Modified: trunk/LayoutTests/http/tests/websocket/tests/hybi/workers/close-expected.txt (109940 => 109941)


--- trunk/LayoutTests/http/tests/websocket/tests/hybi/workers/close-expected.txt	2012-03-06 19:44:53 UTC (rev 109940)
+++ trunk/LayoutTests/http/tests/websocket/tests/hybi/workers/close-expected.txt	2012-03-06 19:50:48 UTC (rev 109941)
@@ -1,6 +1,4 @@
 CONSOLE MESSAGE: WebSocket is closed before the connection is established.
-CONSOLE MESSAGE: WebSocket close message is too long.
-CONSOLE MESSAGE: WebSocket close message is too long.
 CONSOLE MESSAGE: WebSocket is closed before the connection is established.
 Verify WebSocket::close behaviors in Worker.
 

Modified: trunk/Source/WebCore/ChangeLog (109940 => 109941)


--- trunk/Source/WebCore/ChangeLog	2012-03-06 19:44:53 UTC (rev 109940)
+++ trunk/Source/WebCore/ChangeLog	2012-03-06 19:50:48 UTC (rev 109941)
@@ -1,3 +1,17 @@
+2012-03-06  Stephen White  <[email protected]>
+
+        Unreviewed, rolling out r109840.
+        http://trac.webkit.org/changeset/109840
+        https://bugs.webkit.org/show_bug.cgi?id=80103
+
+        Broke WebSocket tests on Chrome Mac and Linux
+
+        * Modules/websockets/WebSocket.cpp:
+        (WebCore::WebSocket::send):
+        (WebCore::WebSocket::close):
+        * Modules/websockets/WebSocketChannel.cpp:
+        (WebCore::WebSocketChannel::send):
+
 2012-03-05  Joseph Pecoraro  <[email protected]>
 
         <http://webkit.org/b/78575> Web Inspector: Disable dock button when not allowed to dock

Modified: trunk/Source/WebCore/Modules/websockets/WebSocket.cpp (109940 => 109941)


--- trunk/Source/WebCore/Modules/websockets/WebSocket.cpp	2012-03-06 19:44:53 UTC (rev 109940)
+++ trunk/Source/WebCore/Modules/websockets/WebSocket.cpp	2012-03-06 19:50:48 UTC (rev 109941)
@@ -288,14 +288,9 @@
         m_bufferedAmountAfterClose = saturateAdd(m_bufferedAmountAfterClose, getFramingOverhead(payloadSize));
         return false;
     }
+    // FIXME: check message is valid utf8.
     ASSERT(m_channel);
-    ThreadableWebSocketChannel::SendResult result = m_channel->send(message);
-    if (result == ThreadableWebSocketChannel::InvalidMessage) {
-        scriptExecutionContext()->addConsoleMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "Websocket message contains invalid character(s).");
-        ec = SYNTAX_ERR;
-        return false;
-    }
-    return result == ThreadableWebSocketChannel::SendSuccess;
+    return m_channel->send(message) == ThreadableWebSocketChannel::SendSuccess;
 }
 
 bool WebSocket::send(ArrayBuffer* binaryData, ExceptionCode& ec)
@@ -348,18 +343,11 @@
             ec = INVALID_ACCESS_ERR;
             return;
         }
-        CString utf8 = reason.utf8(true);
-        if (utf8.length() > maxReasonSizeInBytes) {
-            scriptExecutionContext()->addConsoleMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "WebSocket close message is too long.");
+        // FIXME: if reason contains any unpaired surrogates, raise SYNTAX_ERR.
+        if (reason.utf8().length() > maxReasonSizeInBytes) {
             ec = SYNTAX_ERR;
             return;
         }
-        // Checks whether reason is valid utf8.
-        if (utf8.isNull() && reason.length()) {
-            scriptExecutionContext()->addConsoleMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, "WebSocket close message contains invalid character(s).");
-            ec = SYNTAX_ERR;
-            return;
-        }
     }
 
     if (m_state == CLOSING || m_state == CLOSED)

Modified: trunk/Source/WebCore/Modules/websockets/WebSocketChannel.cpp (109940 => 109941)


--- trunk/Source/WebCore/Modules/websockets/WebSocketChannel.cpp	2012-03-06 19:44:53 UTC (rev 109940)
+++ trunk/Source/WebCore/Modules/websockets/WebSocketChannel.cpp	2012-03-06 19:50:48 UTC (rev 109941)
@@ -160,9 +160,7 @@
 ThreadableWebSocketChannel::SendResult WebSocketChannel::send(const String& message)
 {
     LOG(Network, "WebSocketChannel %p send %s", this, message.utf8().data());
-    CString utf8 = message.utf8(true);
-    if (utf8.isNull() && message.length())
-        return InvalidMessage;
+    CString utf8 = message.utf8();
     if (m_useHixie76Protocol) {
         return sendFrameHixie76(utf8.data(), utf8.length()) ? ThreadableWebSocketChannel::SendSuccess : ThreadableWebSocketChannel::SendFail;
     }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to