Changeset 55602 in webkit


Ignore:
Timestamp:
Mar 5, 2010 4:38:23 PM (14 years ago)
Author:
dpranke@chromium.org
Message:

2010-03-05 Dirk Pranke <dpranke@chromium.org>

Reviewed by Eric Siedel.

Split the command-line invocation of the Chromium/python LigHTTPd
server implementation out into its own top level script to make it
a more "public" interface and to resolve some awkward layering
issues. This script will be called directly by other test scripts in
the Chromium tree.

At some point this script should be made to work with Apache-based
implementations and on other ports. I have filed
https://bugs.webkit.org/show_bug.cgi?id=35820 for this.

Also fix a bug in port/factory where options.chromium could be
dereferenced even if it wasn't set, raising an exception.

https://bugs.webkit.org/show_bug.cgi?id=35812

  • Scripts/webkitpy/layout_tests/port/factory.py:
  • Scripts/webkitpy/layout_tests/port/http_server.py:
  • Scripts/new-run-webkit-httpd: Added
Location:
trunk/WebKitTools
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKitTools/ChangeLog

    r55585 r55602  
     12010-03-05  Dirk Pranke  <dpranke@chromium.org>
     2
     3        Reviewed by Eric Siedel.
     4
     5        Split the command-line invocation of the Chromium/python LigHTTPd
     6        server implementation out into its own top level script to make it
     7        a more "public" interface and to resolve some awkward layering
     8        issues. This script will be called directly by other test scripts in
     9        the Chromium tree.
     10
     11        At some point this script should be made to work with Apache-based
     12        implementations and on other ports. I have filed
     13        https://bugs.webkit.org/show_bug.cgi?id=35820 for this.
     14
     15        Also fix a bug in port/factory where options.chromium could be
     16        dereferenced even if it wasn't set, raising an exception.
     17
     18        https://bugs.webkit.org/show_bug.cgi?id=35812
     19
     20        * Scripts/webkitpy/layout_tests/port/factory.py:
     21        * Scripts/webkitpy/layout_tests/port/http_server.py:
     22        * Scripts/new-run-webkit-httpd: Added
     23
    1242010-03-02  Antonio Gomes  <tonikitoo@webkit.org>
    225
  • trunk/WebKitTools/Scripts/webkitpy/layout_tests/port/factory.py

    r55341 r55602  
    4545            port_to_use = 'chromium-linux'
    4646        elif sys.platform == 'darwin':
    47             if options.chromium:
     47            if options and hasattr(options, 'chromium') and options.chromium:
    4848                port_to_use = 'chromium-mac'
    4949            else:
  • trunk/WebKitTools/Scripts/webkitpy/layout_tests/port/http_server.py

    r55551 r55602  
    235235            self._process.wait()
    236236            self._process = None
    237 
    238 if '__main__' == __name__:
    239     # Provide some command line params for starting/stopping the http server
    240     # manually. Also used in ui_tests to run http layout tests in a browser.
    241     option_parser = optparse.OptionParser()
    242     option_parser.add_option('-k', '--server',
    243         help='Server action (start|stop)')
    244     option_parser.add_option('-p', '--port',
    245         help='Port to listen on (overrides layout test ports)')
    246     option_parser.add_option('-r', '--root',
    247         help='Absolute path to DocumentRoot (overrides layout test roots)')
    248     option_parser.add_option('--register_cygwin', action="store_true",
    249         dest="register_cygwin", help='Register Cygwin paths (on Win try bots)')
    250     option_parser.add_option('--run_background', action="store_true",
    251         dest="run_background",
    252         help='Run on background (for running as UI test)')
    253     options, args = option_parser.parse_args()
    254 
    255     if not options.server:
    256         print ('Usage: %s --server {start|stop} [--root=root_dir]'
    257                ' [--port=port_number]' % sys.argv[0])
    258     else:
    259         if (options.root is None) and (options.port is not None):
    260             # specifying root but not port means we want httpd on default
    261             # set of ports that LayoutTest use, but pointing to a different
    262             # source of tests. Specifying port but no root does not seem
    263             # meaningful.
    264             raise 'Specifying port requires also a root.'
    265         port_obj = factory.get()
    266         httpd = Lighttpd(port_obj,
    267                          tempfile.gettempdir(),
    268                          port=options.port,
    269                          root=options.root,
    270                          register_cygwin=options.register_cygwin,
    271                          run_background=options.run_background)
    272         if 'start' == options.server:
    273             httpd.start()
    274         else:
    275             httpd.stop(force=True)
Note: See TracChangeset for help on using the changeset viewer.