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

Unified Diff: Tools/Scripts/run-blink-httpd

Issue 135583003: checkpoint Blink-side work to use Apache on Windows (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: first complete patch Created 6 years, 10 months 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 side-by-side diff with in-line comments
Download patch
Index: Tools/Scripts/run-blink-httpd
diff --git a/Tools/Scripts/run-blink-httpd b/Tools/Scripts/run-blink-httpd
index a16917661fb2b84c3d2462f6e335b17b1bf77dc3..1a2bba724f5b5e5e5c4196652e1a37401ca8a1fe 100755
--- a/Tools/Scripts/run-blink-httpd
+++ b/Tools/Scripts/run-blink-httpd
@@ -34,61 +34,51 @@
# This script is also used by Chromium's ui_tests to run http layout tests
# in a browser.
#
+import logging
import optparse
-import os
import sys
-import tempfile
+import time
import webkitpy.common.version_check
from webkitpy.common.host import Host
-from webkitpy.layout_tests.servers import http_server
+from webkitpy.layout_tests.servers import apache_http_server
+
+_log = logging.getLogger(__name__)
def run(options):
- if not options.server:
- print ('Usage: %s --server {start|stop} [--root=root_dir]'
- ' [--port=port_number]' % sys.argv[0])
+ host = Host()
+ port_obj = host.port_factory.get(options=options)
+ httpd = apache_http_server.LayoutTestApacheHttpd(port_obj, port_obj.results_directory(), number_of_servers=10)
+ if options.server == 'start':
+ httpd.start()
else:
- if (options.root is None) and (options.port is not None):
- # specifying root but not port means we want httpd on default
- # set of ports that LayoutTest use, but pointing to a different
- # source of tests. Specifying port but no root does not seem
- # meaningful.
- raise 'Specifying port requires also a root.'
- host = Host()
- # FIXME: Make this work with other ports as well.
- port_obj = host.port_factory.get(port_name='chromium', options=options)
- httpd = http_server.Lighttpd(port_obj,
- tempfile.gettempdir(),
- port=options.port,
- root=options.root,
- run_background=options.run_background,
- layout_tests_dir=options.layout_tests_dir)
- if options.server == 'start':
- httpd.start()
- else:
- httpd.stop()
+ httpd.stop()
def main():
option_parser = optparse.OptionParser()
option_parser.add_option('-k', '--server',
help='Server action (start|stop)')
- option_parser.add_option('-p', '--port',
- help='Port to listen on (overrides layout test ports)')
- option_parser.add_option('-r', '--root',
- help='Absolute path to DocumentRoot (overrides layout test roots)')
- option_parser.add_option('--register_cygwin', action="store_true",
- dest="register_cygwin", help='Register Cygwin paths (on Win try bots)')
- option_parser.add_option('--run_background', action="store_true",
- dest="run_background",
- help='Run on background (for running as UI test)')
- option_parser.add_option('--layout_tests_dir',
- dest="layout_tests_dir",
- help='Absolute path to LayoutTests root')
+ option_parser.add_option('-v', '--verbose', action='store_true')
options, args = option_parser.parse_args()
+ #if not options.server:
+ # option_parser.error()
+ # sys.exit(1)
+
+ logging.basicConfig()
+ logger = logging.getLogger()
+ logger.setLevel(logging.DEBUG if options.verbose else logging.INFO)
+ options.server = 'start'
+ run(options)
+ try:
scottmg 2014/02/04 04:58:01 idk when this script is used exactly, but why this
Dirk Pranke 2014/02/04 17:13:16 It's only used when someone wants to run a server
+ while True:
+ time.sleep(1)
+ except KeyboardInterrupt as e:
+ pass
+ options.server = 'stop'
run(options)

Powered by Google App Engine
This is Rietveld 408576698