Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Unified Diff: net/data/websocket/echo-with-no-extension_wsh.py

Issue 11048050: WebSocket test server migration on PPAPI tests (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: pass pylint check Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/data/websocket/close_wsh.py ('k') | net/data/websocket/echo_wsh.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/data/websocket/echo-with-no-extension_wsh.py
diff --git a/net/data/websocket/echo_wsh.py b/net/data/websocket/echo-with-no-extension_wsh.py
similarity index 80%
copy from net/data/websocket/echo_wsh.py
copy to net/data/websocket/echo-with-no-extension_wsh.py
index 86ab63c038f19618c3f8c1013144f00415f97394..a7dca019f4ed7079638e2dfcd9805e1afdfd2a93 100644
--- a/net/data/websocket/echo_wsh.py
+++ b/net/data/websocket/echo-with-no-extension_wsh.py
@@ -2,8 +2,11 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+_GOODBYE_MESSAGE = u'Goodbye'
+
+
def web_socket_do_extra_handshake(request):
- pass # Always accept.
+ request.ws_extension_processors = []
def web_socket_transfer_data(request):
@@ -13,6 +16,7 @@ def web_socket_transfer_data(request):
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)
-
« no previous file with comments | « net/data/websocket/close_wsh.py ('k') | net/data/websocket/echo_wsh.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698