Changeset 57507 in webkit


Ignore:
Timestamp:
Apr 13, 2010 12:48:04 AM (14 years ago)
Author:
abarth@webkit.org
Message:

2010-04-13 Adam Barth <abarth@webkit.org>

Unreviewed, but approved by Dumitru Daniliuc. (This patch is intended
to fix the downstream Chromium build bots. Hopefully it will work!)

Add a driver script for the new websocket server
https://bugs.webkit.org/show_bug.cgi?id=37495

websocket_server.py can't be run directly because its a module and not
a standalone script. This used to work by accident because it didn't
depend on any other modules.

  • Scripts/new-run-webkit-websocketserver: Added.
  • Scripts/webkitpy/layout_tests/port/websocket_server.py:
Location:
trunk/WebKitTools
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r57500 r57507  
     12010-04-13  Adam Barth  <abarth@webkit.org>
     2
     3        Unreviewed, but approved by Dumitru Daniliuc.  (This patch is intended
     4        to fix the downstream Chromium build bots.  Hopefully it will work!)
     5
     6        Add a driver script for the new websocket server
     7        https://bugs.webkit.org/show_bug.cgi?id=37495
     8
     9        websocket_server.py can't be run directly because its a module and not
     10        a standalone script.  This used to work by accident because it didn't
     11        depend on any other modules.
     12
     13        * Scripts/new-run-webkit-websocketserver: Added.
     14        * Scripts/webkitpy/layout_tests/port/websocket_server.py:
     15
    1162010-04-12  Eric Seidel  <eric@webkit.org>
    217
  • trunk/WebKitTools/Scripts/webkitpy/layout_tests/port/websocket_server.py

    r57444 r57507  
    264264            self._wsout.close()
    265265            self._wsout = None
    266 
    267 
    268 if '__main__' == __name__:
    269     # Provide some command line params for starting the PyWebSocket server
    270     # manually.
    271     option_parser = optparse.OptionParser()
    272     option_parser.add_option('--server', type='choice',
    273                              choices=['start', 'stop'], default='start',
    274                              help='Server action (start|stop)')
    275     option_parser.add_option('-p', '--port', dest='port',
    276                              default=None, help='Port to listen on')
    277     option_parser.add_option('-r', '--root',
    278                              help='Absolute path to DocumentRoot '
    279                                   '(overrides layout test roots)')
    280     option_parser.add_option('-t', '--tls', dest='use_tls',
    281                              action='store_true',
    282                              default=False, help='use TLS (wss://)')
    283     option_parser.add_option('-k', '--private_key', dest='private_key',
    284                              default='', help='TLS private key file.')
    285     option_parser.add_option('-c', '--certificate', dest='certificate',
    286                              default='', help='TLS certificate file.')
    287     option_parser.add_option('--register_cygwin', action="store_true",
    288                              dest="register_cygwin",
    289                              help='Register Cygwin paths (on Win try bots)')
    290     option_parser.add_option('--pidfile', help='path to pid file.')
    291     options, args = option_parser.parse_args()
    292 
    293     if not options.port:
    294         if options.use_tls:
    295             options.port = _DEFAULT_WSS_PORT
    296         else:
    297             options.port = _DEFAULT_WS_PORT
    298 
    299     kwds = {'port': options.port, 'use_tls': options.use_tls}
    300     if options.root:
    301         kwds['root'] = options.root
    302     if options.private_key:
    303         kwds['private_key'] = options.private_key
    304     if options.certificate:
    305         kwds['certificate'] = options.certificate
    306     kwds['register_cygwin'] = options.register_cygwin
    307     if options.pidfile:
    308         kwds['pidfile'] = options.pidfile
    309 
    310     port_obj = factory.get()
    311     pywebsocket = PyWebSocket(port_obj, tempfile.gettempdir(), **kwds)
    312 
    313     if 'start' == options.server:
    314         pywebsocket.start()
    315     else:
    316         pywebsocket.stop(force=True)
Note: See TracChangeset for help on using the changeset viewer.