Index: Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/wptserve/wptserve/wptserve.py |
diff --git a/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/wptserve/wptserve/wptserve.py b/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/wptserve/wptserve/wptserve.py |
new file mode 100755 |
index 0000000000000000000000000000000000000000..816c8a5a6aaec2ae985c3fb3ceebd1259a5a4f23 |
--- /dev/null |
+++ b/Tools/Scripts/webkitpy/thirdparty/wpt/wpt/tools/wptserve/wptserve/wptserve.py |
@@ -0,0 +1,33 @@ |
+#!/usr/bin/env python |
+import argparse |
+import os |
+ |
+import server |
+ |
+def abs_path(path): |
+ return os.path.abspath(path) |
+ |
+ |
+def parse_args(): |
+ parser = argparse.ArgumentParser(description="HTTP server designed for extreme flexibility " |
+ "required in testing situations.") |
+ parser.add_argument("document_root", action="store", type=abs_path, |
+ help="Root directory to serve files from") |
+ parser.add_argument("--port", "-p", dest="port", action="store", |
+ type=int, default=8000, |
+ help="Port number to run server on") |
+ parser.add_argument("--host", "-H", dest="host", action="store", |
+ type=str, default="127.0.0.1", |
+ help="Host to run server on") |
+ return parser.parse_args() |
+ |
+ |
+def main(): |
+ args = parse_args() |
+ httpd = server.WebTestHttpd(host=args.host, port=args.port, |
+ use_ssl=False, certificate=None, |
+ doc_root=args.document_root) |
+ httpd.start() |
+ |
+if __name__ == "__main__": |
+ main() |