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

Side by Side Diff: LayoutTests/http/tests/websocket/too-long-payload_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 import time 2 import time
3 from mod_pywebsocket import common 3 from mod_pywebsocket import common
4 4
5 5
6 def web_socket_do_extra_handshake(request): 6 def web_socket_do_extra_handshake(request):
7 pass 7 pass
8 8
9 9
10 def web_socket_transfer_data(request): 10 def web_socket_transfer_data(request):
11 length = 0x8000000000000000 11 length = 0x8000000000000000
12 12
13 # pywebsocket refuses to send a frame with too long payload. 13 # pywebsocket refuses to send a frame with too long payload.
14 # Thus, we need to build a frame manually. 14 # Thus, we need to build a frame manually.
15 header = chr(0x80 | common.OPCODE_TEXT) # 0x80 is for "fin" bit. 15 header = chr(0x80 | common.OPCODE_TEXT) # 0x80 is for "fin" bit.
16 header += chr(127) 16 header += chr(127)
17 header += struct.pack('!Q', length) 17 header += struct.pack('!Q', length)
18 request.connection.write(header) 18 request.connection.write(header)
19 19
20 # Send data indefinitely to simulate a real (broken) server sending a big fr ame. 20 # Send data indefinitely to simulate a real (broken) server sending a big fr ame.
21 # A client should ignore these bytes and abort the connection. 21 # A client should ignore these bytes and abort the connection.
22 while True: 22 while True:
23 request.connection.write('X' * 4096) 23 request.connection.write('X' * 4096)
24 time.sleep(1) 24 time.sleep(1)
OLDNEW
« no previous file with comments | « LayoutTests/http/tests/websocket/too-long-payload-expected.txt ('k') | LayoutTests/http/tests/websocket/unicode.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698