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

Unified Diff: LayoutTests/http/tests/websocket/tests/hybi/client-close_wsh.py

Issue 101143002: Remove hybi sub directory for WebSocket layout tests (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years 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/tests/hybi/client-close_wsh.py
diff --git a/LayoutTests/http/tests/websocket/tests/hybi/client-close_wsh.py b/LayoutTests/http/tests/websocket/tests/hybi/client-close_wsh.py
deleted file mode 100644
index e2b36e1a829d30d74141436fd5139e1aca38e185..0000000000000000000000000000000000000000
--- a/LayoutTests/http/tests/websocket/tests/hybi/client-close_wsh.py
+++ /dev/null
@@ -1,29 +0,0 @@
-import struct
-
-from mod_pywebsocket import msgutil
-from mod_pywebsocket import stream
-
-def web_socket_do_extra_handshake(request):
- pass
-
-
-def web_socket_transfer_data(request):
- # Wait for a close frame sent from the client.
- close_frame = request.ws_stream.receive_bytes(6)
-
- msgutil.send_message(request, 'Client should ignore this message')
-
- # Send only first two bytes of the received frame. The remaining four bytes are
- # "masking key", which changes every time the test runs.
- data = struct.pack('!H', 1000) + 'close_frame[:2]=%r' % close_frame[:2]
- request.connection.write(stream.create_close_frame(data))
-
- # If the following assertion fails, AssertionError will be raised,
- # which will prevent pywebsocket from sending a close frame.
- # In this case, the client will fail to finish closing handshake, thus
- # closeEvent.wasClean will become false.
- assert close_frame[:2] == '\x88\x80'
-
- # Pretend we have received a close frame from the client.
- # After this function exits, pywebsocket will send a close frame automatically.
- request.client_terminated = True

Powered by Google App Engine
This is Rietveld 408576698