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

Side by Side Diff: LayoutTests/http/tests/websocket/fragmented-binary-frames_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 unified diff | Download patch
OLDNEW
1 from mod_pywebsocket import common 1 from mod_pywebsocket import common
2 from mod_pywebsocket import stream 2 from mod_pywebsocket import stream
3 3
4 4
5 def web_socket_do_extra_handshake(request): 5 def web_socket_do_extra_handshake(request):
6 pass 6 pass
7 7
8 8
9 def web_socket_transfer_data(request): 9 def web_socket_transfer_data(request):
10 messages_to_send = [['Hello, ', 'world!'], 10 messages_to_send = [['Hello, ', 'world!'],
11 ['', 'Hello, ', '', 'world!', ''], 11 ['', 'Hello, ', '', 'world!', ''],
12 ['', '', ''], 12 ['', '', ''],
13 [chr(i) for i in xrange(256)]] 13 [chr(i) for i in xrange(256)]]
14 for message_list in messages_to_send: 14 for message_list in messages_to_send:
15 for index, message in enumerate(message_list): 15 for index, message in enumerate(message_list):
16 # FIXME: Should use better API to send binary messages when pywebsoc ket supports it. 16 # FIXME: Should use better API to send binary messages when pywebsoc ket supports it.
17 if index == 0: 17 if index == 0:
18 opcode = common.OPCODE_BINARY 18 opcode = common.OPCODE_BINARY
19 else: 19 else:
20 opcode = common.OPCODE_CONTINUATION 20 opcode = common.OPCODE_CONTINUATION
21 if index < len(message_list) - 1: 21 if index < len(message_list) - 1:
22 final = 0 22 final = 0
23 else: 23 else:
24 final = 1 24 final = 1
25 header = stream.create_header(opcode, len(message), final, 0, 0, 0, 0) 25 header = stream.create_header(opcode, len(message), final, 0, 0, 0, 0)
26 request.connection.write(header + message) 26 request.connection.write(header + message)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698