diff options
author | yhirano@chromium.org <yhirano@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-24 04:49:23 +0000 |
---|---|---|
committer | yhirano@chromium.org <yhirano@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-24 04:49:23 +0000 |
commit | b7b2c9d0dc5f35c9d0796dc78e6993274cfe4110 (patch) | |
tree | 37d42acb1282e4ebb1ef5ddebc3cdb98e43556ca /net | |
parent | e10fbf1a880c936bee0ad4fff1daf4441794790a (diff) | |
download | chromium_src-b7b2c9d0dc5f35c9d0796dc78e6993274cfe4110.zip chromium_src-b7b2c9d0dc5f35c9d0796dc78e6993274cfe4110.tar.gz chromium_src-b7b2c9d0dc5f35c9d0796dc78e6993274cfe4110.tar.bz2 |
[WebSocket] Fix and enable flaky browser test.
Fix and enable WebSocketBrowserTest.SecureWebSocketSplitRecords because
Updating pywebsocket fixes the flakiness.
BUG=176867
R=tyoshino
Review URL: https://codereview.chromium.org/205963002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@258874 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net')
-rw-r--r-- | net/data/websocket/close-with-split-packet_wsh.py | 11 | ||||
-rw-r--r-- | net/data/websocket/split_packet_check.html | 2 | ||||
-rwxr-xr-x | net/tools/testserver/testserver.py | 5 |
3 files changed, 9 insertions, 9 deletions
diff --git a/net/data/websocket/close-with-split-packet_wsh.py b/net/data/websocket/close-with-split-packet_wsh.py index d5185c4..3bd5b58 100644 --- a/net/data/websocket/close-with-split-packet_wsh.py +++ b/net/data/websocket/close-with-split-packet_wsh.py @@ -13,17 +13,12 @@ def web_socket_do_extra_handshake(_request): def web_socket_transfer_data(request): - line = request.ws_stream.receive_message() - if line is None: - return - if isinstance(line, unicode): - request.ws_stream.send_message(line, binary=False) - else: - request.ws_stream.send_message(line, binary=True) + # Just waiting... + request.ws_stream.receive_message() def web_socket_passive_closing_handshake(request): - code = struct.pack('!H', 1000) + code = struct.pack('!H', 3004) packet = stream.create_close_frame(code + 'split test'.encode('utf-8')) request.connection.write(packet[:1]) request.connection.write(packet[1:]) diff --git a/net/data/websocket/split_packet_check.html b/net/data/websocket/split_packet_check.html index 8e273ec..a7f4c36 100644 --- a/net/data/websocket/split_packet_check.html +++ b/net/data/websocket/split_packet_check.html @@ -26,7 +26,7 @@ ws.onopen = function() ws.onclose = function(event) { // Check wasClean, then set proper title. - if (event.wasClean) + if (event.wasClean && event.code === 3004 && event.reason === 'split test') document.title = 'PASS'; else document.title = 'FAIL'; diff --git a/net/tools/testserver/testserver.py b/net/tools/testserver/testserver.py index 0a1f59b..13aafcd 100755 --- a/net/tools/testserver/testserver.py +++ b/net/tools/testserver/testserver.py @@ -27,6 +27,7 @@ import re import select import socket import SocketServer +import ssl import struct import sys import threading @@ -51,7 +52,10 @@ import tlslite.api # Insert at the beginning of the path, we want this to be used # unconditionally. sys.path.insert(0, os.path.join(ROOT_DIR, 'third_party', 'pywebsocket', 'src')) +import mod_pywebsocket.standalone from mod_pywebsocket.standalone import WebSocketServer +# import manually +mod_pywebsocket.standalone.ssl = ssl SERVER_HTTP = 0 SERVER_FTP = 1 @@ -84,6 +88,7 @@ class WebSocketOptions: self.certificate = None self.tls_client_auth = False self.tls_client_ca = None + self.tls_module = 'ssl' self.use_basic_auth = False |