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

Unified Diff: LayoutTests/http/tests/websocket/close_wsh.py

Issue 913273004: [OBSOLETE] De-flake the websocket/close.html layout test (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Hack around Mac timeouts. Created 5 years, 9 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
Index: LayoutTests/http/tests/websocket/close_wsh.py
diff --git a/LayoutTests/http/tests/websocket/close_wsh.py b/LayoutTests/http/tests/websocket/close_wsh.py
index 1b02d66267e294ce83977dac64f075981705647c..225aaf5985af23d44bc35899d405892268882630 100644
--- a/LayoutTests/http/tests/websocket/close_wsh.py
+++ b/LayoutTests/http/tests/websocket/close_wsh.py
@@ -29,7 +29,9 @@
import logging
-_GOODBYE_MESSAGE = u'Goodbye'
+
+
+from mod_pywebsocket import msgutil
def web_socket_do_extra_handshake(request):
@@ -37,16 +39,18 @@ def web_socket_do_extra_handshake(request):
def web_socket_transfer_data(request):
- while True:
- 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:
+ try:
+ while True:
+ line = request.ws_stream.receive_message()
+ if line is None:
return
- else:
- request.ws_stream.send_message(line, binary=True)
+ if isinstance(line, unicode):
+ request.ws_stream.send_message(line, binary=False)
+ else:
+ request.ws_stream.send_message(line, binary=True)
+ except msgutil.BadOperationException, e:
+ # FIXME: Find out what causes this.
+ logging.getLogger().error("Exception happened", exc_info=True)
def web_socket_passive_closing_handshake(request):
« no previous file with comments | « LayoutTests/http/tests/websocket/close-expected.txt ('k') | LayoutTests/http/tests/websocket/resources/close-common.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698