[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.17-1283-gcf603cf
eric at webkit.org
eric at webkit.org
Tue Jan 5 23:42:20 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit f39d8342daf5f9ef7fb64ff62920e8bf4f39c059
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Dec 4 08:25:22 2009 +0000
2009-12-04 Yuzo Fujishima <yuzo at google.com>
Reviewed by Darin Fisher.
Add test to see if unicode messages can be sent over web socket.
https://bugs.webkit.org/show_bug.cgi?id=31341
* websocket/tests/script-tests/unicode.js: Added.
(endTest):
(ws.onopen):
(ws.onmessage):
(ws.onclose):
(timeOutCallback):
* websocket/tests/unicode-expected.txt: Added.
* websocket/tests/unicode.html: Added.
* websocket/tests/unicode_wsh.py: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51686 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index baf7661..071dc42 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,21 @@
+2009-12-04 Yuzo Fujishima <yuzo at google.com>
+
+ Reviewed by Darin Fisher.
+
+ Add test to see if unicode messages can be sent over web socket.
+
+ https://bugs.webkit.org/show_bug.cgi?id=31341
+
+ * websocket/tests/script-tests/unicode.js: Added.
+ (endTest):
+ (ws.onopen):
+ (ws.onmessage):
+ (ws.onclose):
+ (timeOutCallback):
+ * websocket/tests/unicode-expected.txt: Added.
+ * websocket/tests/unicode.html: Added.
+ * websocket/tests/unicode_wsh.py: Added.
+
2009-12-03 Chris Fleizach <cfleizach at apple.com>
Reviewed by Beth Dakin.
diff --git a/LayoutTests/websocket/tests/script-tests/unicode.js b/LayoutTests/websocket/tests/script-tests/unicode.js
new file mode 100644
index 0000000..a2df5a9
--- /dev/null
+++ b/LayoutTests/websocket/tests/script-tests/unicode.js
@@ -0,0 +1,52 @@
+description("Web Socket unicode message test");
+
+if (window.layoutTestController)
+ layoutTestController.waitUntilDone();
+
+function endTest()
+{
+ isSuccessfullyParsed();
+ clearTimeout(timeoutID);
+ if (window.layoutTestController)
+ layoutTestController.notifyDone();
+}
+
+var ws = new WebSocket("ws://localhost:8880/websocket/tests/unicode");
+
+// Hello in Japanese
+var UNICODE_HELLO = "\u3053\u3093\u306b\u3061\u306f";
+// Goodbye in Japanese
+var UNICODE_GOODBYE = "\u3055\u3088\u3046\u306a\u3089";
+
+// data needs to be global to be accessbile from shouldBe().
+var data = "";
+
+ws.onopen = function()
+{
+ debug("Connected.");
+ debug("Send UNICODE_HELLO.");
+ ws.send(UNICODE_HELLO);
+};
+
+ws.onmessage = function(messageEvent)
+{
+ // The server should send back Goodbye if it receives Hello.
+ data = messageEvent.data;
+ shouldBe("data", "UNICODE_GOODBYE");
+};
+
+ws.onclose = function()
+{
+ debug("Closed.");
+ endTest();
+};
+
+function timeOutCallback()
+{
+ testFailed("Timed out in state: " + ws.readyState);
+ endTest();
+}
+
+var timeoutID = setTimeout(timeOutCallback, 3000);
+
+var successfullyParsed = true;
diff --git a/LayoutTests/websocket/tests/unicode-expected.txt b/LayoutTests/websocket/tests/unicode-expected.txt
new file mode 100644
index 0000000..a89eb83
--- /dev/null
+++ b/LayoutTests/websocket/tests/unicode-expected.txt
@@ -0,0 +1,12 @@
+Web Socket unicode message test
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+Connected.
+Send UNICODE_HELLO.
+PASS data is UNICODE_GOODBYE
+Closed.
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/websocket/tests/unicode.html b/LayoutTests/websocket/tests/unicode.html
new file mode 100644
index 0000000..f0c4566
--- /dev/null
+++ b/LayoutTests/websocket/tests/unicode.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/unicode.js"></script>
+</body>
+</html>
diff --git a/LayoutTests/websocket/tests/unicode_wsh.py b/LayoutTests/websocket/tests/unicode_wsh.py
new file mode 100644
index 0000000..9e31237
--- /dev/null
+++ b/LayoutTests/websocket/tests/unicode_wsh.py
@@ -0,0 +1,52 @@
+# 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
+
+
+# Hello in Japanese
+_UNICODE_HELLO = u"\u3053\u3093\u306b\u3061\u306f"
+
+# Goodbye in Japanese
+_UNICODE_GOODBYE = u"\u3055\u3088\u3046\u306a\u3089"
+
+# Error message
+_ERROR_MESSAGE = "What did you say?"
+
+
+def web_socket_do_extra_handshake(request):
+ pass # Always accept.
+
+
+def web_socket_transfer_data(request):
+ hello = msgutil.receive_message(request)
+ if hello != _UNICODE_HELLO:
+ msgutil.send_message(request, _ERROR_MESSAGE)
+ return
+ msgutil.send_message(request, _UNICODE_GOODBYE)
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list