Changeset 90099 in webkit


Ignore:
Timestamp:
Jun 30, 2011 2:22:49 AM (13 years ago)
Author:
yutak@chromium.org
Message:

2011-06-30 Yuta Kitamura <yutak@chromium.org>

Reviewed by Kent Tamura.

WebSocket: Fix style issues of pywebsocket handlers
https://bugs.webkit.org/show_bug.cgi?id=63689

Fix minor style errors such as wrong indentation or wrong number of blank lines.

  • http/tests/websocket/tests/bad-handshake-crash_wsh.py:
  • http/tests/websocket/tests/close-on-unload_wsh.py:
  • http/tests/websocket/tests/echo-challenge_wsh.py:
  • http/tests/websocket/tests/echo-cookie_wsh.py:
  • http/tests/websocket/tests/frame-length-longer-than-buffer_wsh.py:
  • http/tests/websocket/tests/frame-length-overflow_wsh.py:
  • http/tests/websocket/tests/frame-length-skip_wsh.py:
  • http/tests/websocket/tests/handshake-fail-by-maxlength_wsh.py: Use sequence repetition pattern instead of a loop.
  • http/tests/websocket/tests/handshake-fail-by-no-connection-header_wsh.py:
  • http/tests/websocket/tests/handshake-fail-by-no-cr_wsh.py:
  • http/tests/websocket/tests/handshake-fail-by-no-upgrade-header_wsh.py:
  • http/tests/websocket/tests/handshake-fail-by-prepended-null_wsh.py:
  • http/tests/websocket/tests/hanging-handshake_wsh.py:
  • http/tests/websocket/tests/long-invalid-header_wsh.py:
  • http/tests/websocket/tests/send2_wsh.py:
  • http/tests/websocket/tests/unknown-frame-type_wsh.py:
  • http/tests/websocket/tests/workers/resources/echo-challenge_wsh.py:
Location:
trunk/LayoutTests
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r90097 r90099  
     12011-06-30  Yuta Kitamura  <yutak@chromium.org>
     2
     3        Reviewed by Kent Tamura.
     4
     5        WebSocket: Fix style issues of pywebsocket handlers
     6        https://bugs.webkit.org/show_bug.cgi?id=63689
     7
     8        Fix minor style errors such as wrong indentation or wrong number of blank lines.
     9
     10        * http/tests/websocket/tests/bad-handshake-crash_wsh.py:
     11        * http/tests/websocket/tests/close-on-unload_wsh.py:
     12        * http/tests/websocket/tests/echo-challenge_wsh.py:
     13        * http/tests/websocket/tests/echo-cookie_wsh.py:
     14        * http/tests/websocket/tests/frame-length-longer-than-buffer_wsh.py:
     15        * http/tests/websocket/tests/frame-length-overflow_wsh.py:
     16        * http/tests/websocket/tests/frame-length-skip_wsh.py:
     17        * http/tests/websocket/tests/handshake-fail-by-maxlength_wsh.py:
     18        Use sequence repetition pattern instead of a loop.
     19        * http/tests/websocket/tests/handshake-fail-by-no-connection-header_wsh.py:
     20        * http/tests/websocket/tests/handshake-fail-by-no-cr_wsh.py:
     21        * http/tests/websocket/tests/handshake-fail-by-no-upgrade-header_wsh.py:
     22        * http/tests/websocket/tests/handshake-fail-by-prepended-null_wsh.py:
     23        * http/tests/websocket/tests/hanging-handshake_wsh.py:
     24        * http/tests/websocket/tests/long-invalid-header_wsh.py:
     25        * http/tests/websocket/tests/send2_wsh.py:
     26        * http/tests/websocket/tests/unknown-frame-type_wsh.py:
     27        * http/tests/websocket/tests/workers/resources/echo-challenge_wsh.py:
     28
    1292011-06-30  Kent Tamura  <tkent@chromium.org>
    230
  • trunk/LayoutTests/http/tests/websocket/tests/bad-handshake-crash_wsh.py

    r57760 r90099  
    11def web_socket_do_extra_handshake(request):
    2   msg = "HTTP/1.1 101 Web Socket Protocol Handshake\r\n"
    3   msg += "Upgrade: WebSocket\r\n"
    4   msg += "Connection: Upgrade\r\n"
    5   msg += "\xa5:\r\n"
    6   msg += "\r\n"
    7   request.connection.write(msg)
    8   print msg
     2    msg = "HTTP/1.1 101 Web Socket Protocol Handshake\r\n"
     3    msg += "Upgrade: WebSocket\r\n"
     4    msg += "Connection: Upgrade\r\n"
     5    msg += "\xa5:\r\n"
     6    msg += "\r\n"
     7    request.connection.write(msg)
     8    print msg
     9
    910
    1011def web_socket_transfer_data(request):
    11   pass
     12    pass
  • trunk/LayoutTests/http/tests/websocket/tests/close-on-unload_wsh.py

    r54404 r90099  
    3131from mod_pywebsocket import msgutil
    3232
     33
    3334# we don't use set() here, because python on mac tiger doesn't support it.
    3435connections = {}
     36
    3537
    3638def web_socket_do_extra_handshake(request):
     
    5355        for ws in connections.keys():
    5456            msgutil.send_message(ws, socketName)
    55 
  • trunk/LayoutTests/http/tests/websocket/tests/echo-challenge_wsh.py

    r63298 r90099  
    11from mod_pywebsocket import msgutil
     2
    23
    34def web_socket_do_extra_handshake(request):
    45    pass
    56
     7
    68def web_socket_transfer_data(request):
    79    msgutil.send_message(request, _hexify(request.ws_challenge))
    810
     11
    912def _hexify(bytes):
    1013    return ':'.join(['%02X' % ord(byte) for byte in bytes])
  • trunk/LayoutTests/http/tests/websocket/tests/echo-cookie_wsh.py

    r55719 r90099  
    3030from mod_pywebsocket import msgutil
    3131
     32
    3233def web_socket_do_extra_handshake(request):
    3334    pass
    3435
     36
    3537def web_socket_transfer_data(request):
    3638    msgutil.send_message(request,  request.headers_in['Cookie'])
  • trunk/LayoutTests/http/tests/websocket/tests/frame-length-longer-than-buffer_wsh.py

    r87674 r90099  
    11def web_socket_do_extra_handshake(request):
    22    pass
     3
    34
    45def web_socket_transfer_data(request):
  • trunk/LayoutTests/http/tests/websocket/tests/frame-length-overflow_wsh.py

    r65135 r90099  
    11def web_socket_do_extra_handshake(request):
    2   pass
     2    pass
     3
    34
    45def web_socket_transfer_data(request):
    5   msg = 16 * '\xff'
    6   request.connection.write(msg)
     6    msg = 16 * '\xff'
     7    request.connection.write(msg)
  • trunk/LayoutTests/http/tests/websocket/tests/frame-length-skip_wsh.py

    r51829 r90099  
    11def web_socket_do_extra_handshake(request):
    2   pass
     2    pass
     3
    34
    45def web_socket_transfer_data(request):
    5   msg = "\0hello\xff"
    6   msg += "\x80\x81\x01"   # skip 1*128+1 bytes.
    7   msg += "\x01"
    8   msg += "\0should be skipped" + (" " * 109) + "\xff"
    9   msg += "\0world\xff"
    10   request.connection.write(msg)
    11   print msg
     6    msg = "\0hello\xff"
     7    msg += "\x80\x81\x01"   # skip 1*128+1 bytes.
     8    msg += "\x01"
     9    msg += "\0should be skipped" + (" " * 109) + "\xff"
     10    msg += "\0world\xff"
     11    request.connection.write(msg)
     12    print msg
  • trunk/LayoutTests/http/tests/websocket/tests/handshake-fail-by-maxlength_wsh.py

    r75461 r90099  
    2222import time
    2323
     24
    2425def web_socket_do_extra_handshake(request):
    2526    # This will cause the handshake to fail because it pushes the length of the
    2627    # status line past 1024 characters
    27     msg = ""
    28     for i in range(0, 1024):
    29         msg += "."
     28    msg = '.' * 1024
    3029    msg += 'HTTP/1.1 101 WebSocket Protocol Handshake\r\n'
    3130    msg += 'Upgrade: WebSocket\r\n'
     
    4140        request.connection.write('keepalive\n')
    4241
     42
    4343def web_socket_transfer_data(request):
    4444    pass
  • trunk/LayoutTests/http/tests/websocket/tests/handshake-fail-by-no-connection-header_wsh.py

    r80252 r90099  
    1010    print msg
    1111
     12
    1213def web_socket_transfer_data(request):
    1314    pass
  • trunk/LayoutTests/http/tests/websocket/tests/handshake-fail-by-no-cr_wsh.py

    r61671 r90099  
    1010    print msg
    1111
     12
    1213def web_socket_transfer_data(request):
    1314    pass
  • trunk/LayoutTests/http/tests/websocket/tests/handshake-fail-by-no-upgrade-header_wsh.py

    r80252 r90099  
    1010    print msg
    1111
     12
    1213def web_socket_transfer_data(request):
    1314    pass
  • trunk/LayoutTests/http/tests/websocket/tests/handshake-fail-by-prepended-null_wsh.py

    r75461 r90099  
    2121
    2222import time
     23
    2324
    2425def web_socket_do_extra_handshake(request):
     
    4647            request.connection.write(frame)
    4748
     49
    4850def web_socket_transfer_data(request):
    4951    pass
  • trunk/LayoutTests/http/tests/websocket/tests/hanging-handshake_wsh.py

    r82088 r90099  
    22    request.connection.read()
    33
     4
    45def web_socket_transfer_data(request):
    56    pass
    6 
  • trunk/LayoutTests/http/tests/websocket/tests/long-invalid-header_wsh.py

    r56380 r90099  
    11def web_socket_do_extra_handshake(request):
    2   msg = "HTTP/1.1 101 Web Socket Protocol Handshake\r\n"
    3   msg += ("p" * 1024) + "\r\n"
    4   request.connection.write(msg)
     2    msg = "HTTP/1.1 101 Web Socket Protocol Handshake\r\n"
     3    msg += ("p" * 1024) + "\r\n"
     4    request.connection.write(msg)
     5
    56
    67def web_socket_transfer_data(request):
    7   msg = "HTTP/1.1 101 Web Socket Protocol Handshake\r\n"
    8   msg += ("p" * 1024) + "\r\n"
    9   request.connection.write(msg)
     8    msg = "HTTP/1.1 101 Web Socket Protocol Handshake\r\n"
     9    msg += ("p" * 1024) + "\r\n"
     10    request.connection.write(msg)
  • trunk/LayoutTests/http/tests/websocket/tests/send2_wsh.py

    r61375 r90099  
    11def web_socket_do_extra_handshake(request):
    22    pass # Always accept.
     3
    34
    45def web_socket_transfer_data(request):
  • trunk/LayoutTests/http/tests/websocket/tests/unknown-frame-type_wsh.py

    r55573 r90099  
    11from mod_pywebsocket import msgutil
     2
    23
    34def web_socket_do_extra_handshake(request):
    45    pass
     6
    57
    68def web_socket_transfer_data(request):
  • trunk/LayoutTests/http/tests/websocket/tests/workers/resources/echo-challenge_wsh.py

    r63524 r90099  
    11from mod_pywebsocket import msgutil
     2
    23
    34def web_socket_do_extra_handshake(request):
    45    pass
    56
     7
    68def web_socket_transfer_data(request):
    79    msgutil.send_message(request, _hexify(request.ws_challenge))
    810
     11
    912def _hexify(bytes):
    1013    return ':'.join(['%02X' % ord(byte) for byte in bytes])
Note: See TracChangeset for help on using the changeset viewer.