Bug 1356652 - Expose Speedometer to PGO HTTP server; r=froydnj,glandium

The HTTP server can dynamically map URLs to local filesystem paths.
We employ this so Speedometer's files are available to the server.

MozReview-Commit-ID: EpF1aD6meZH

--HG--
extra : rebase_source : 70f80e073c2bec92c9429dcc35cd12e27018f3cb
This commit is contained in:
Gregory Szorc 2017-08-25 10:33:11 -07:00
parent 02808039fc
commit 7253036dad

View File

@ -17,13 +17,23 @@ from mozrunner import FirefoxRunner, CLI
PORT = 8888
PATH_MAPPINGS = {
'/js-input/speedometer': 'third_party/speedometer',
}
if __name__ == '__main__':
cli = CLI()
debug_args, interactive = cli.debugger_arguments()
build = MozbuildObject.from_environment()
path_mappings = {
k: os.path.join(build.topsrcdir, v)
for k, v in PATH_MAPPINGS.items()
}
httpd = MozHttpd(port=PORT,
docroot=os.path.join(build.topsrcdir, "build", "pgo"))
docroot=os.path.join(build.topsrcdir, "build", "pgo"),
path_mappings=path_mappings)
httpd.start(block=False)
locations = ServerLocations()