Title: [101974] trunk/LayoutTests
Revision
101974
Author
[email protected]
Date
2011-12-04 23:42:19 -0800 (Sun, 04 Dec 2011)

Log Message

Add binary support in WebSocket test server's echo handler.
https://bugs.webkit.org/show_bug.cgi?id=73649

Patch by Takashi Toyoshima <[email protected]> on 2011-12-04
Reviewed by Eric Seidel.

* http/tests/websocket/tests/hybi/echo_wsh.py: Support binary frames.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (101973 => 101974)


--- trunk/LayoutTests/ChangeLog	2011-12-05 06:52:20 UTC (rev 101973)
+++ trunk/LayoutTests/ChangeLog	2011-12-05 07:42:19 UTC (rev 101974)
@@ -1,3 +1,12 @@
+2011-12-04  Takashi Toyoshima  <[email protected]>
+
+        Add binary support in WebSocket test server's echo handler.
+        https://bugs.webkit.org/show_bug.cgi?id=73649
+
+        Reviewed by Eric Seidel.
+
+        * http/tests/websocket/tests/hybi/echo_wsh.py: Support binary frames.
+
 2011-12-04  Kent Tamura  <[email protected]>
 
         [Chromium] Rebaseline of placeholder tests for r101742 and r101848.

Modified: trunk/LayoutTests/http/tests/websocket/tests/hybi/echo_wsh.py (101973 => 101974)


--- trunk/LayoutTests/http/tests/websocket/tests/hybi/echo_wsh.py	2011-12-05 06:52:20 UTC (rev 101973)
+++ trunk/LayoutTests/http/tests/websocket/tests/hybi/echo_wsh.py	2011-12-05 07:42:19 UTC (rev 101974)
@@ -1,4 +1,4 @@
-# Copyright 2009, Google Inc.
+# Copyright 2009, 2011, Google Inc.
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -28,19 +28,21 @@
 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 
-from mod_pywebsocket import msgutil
+_GOODBYE_MESSAGE = u'Goodbye'
 
 
-_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:
+        line = request.ws_stream.receive_message()
+        if line is None:
             return
+        if isinstance(line, unicode):
+            request.ws_stream.send_message(line, binary=False)
+            if line == _GOODBYE_MESSAGE:
+                return
+        else:
+            request.ws_stream.send_message(line, binary=True)
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to