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

Side by Side Diff: LayoutTests/http/tests/websocket/close-code-and-reason_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 import struct 1 import struct
2 2
3 from mod_pywebsocket import stream 3 from mod_pywebsocket import stream
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 def web_socket_transfer_data(request): 8 def web_socket_transfer_data(request):
9 line = request.ws_stream.receive_message() 9 line = request.ws_stream.receive_message()
10 if line is None: 10 if line is None:
11 return 11 return
12 if line == '-': 12 if line == '-':
13 data = '' 13 data = ''
14 elif line == '--': 14 elif line == '--':
15 data = 'X' 15 data = 'X'
16 else: 16 else:
17 code, reason = line.split(' ', 1) 17 code, reason = line.split(' ', 1)
18 data = struct.pack('!H', int(code)) + reason.encode('utf-8') 18 data = struct.pack('!H', int(code)) + reason.encode('utf-8')
19 request.connection.write(stream.create_close_frame(data)) 19 request.connection.write(stream.create_close_frame(data))
OLDNEW
« no previous file with comments | « LayoutTests/http/tests/websocket/close-code-and-reason-expected.txt ('k') | LayoutTests/http/tests/websocket/close-event.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698