Bug 1150512 - Move Marionette test runner to wptserve; r=automatedtester

--HG--
extra : commitid : 1DWdAQuXZz
extra : rebase_source : e58b63b2209e30cd0bdd44f82ceda8495bd0c604
extra : histedit_source : 6278a8fc009cc99b432bc880eaa59bb5d1597685
This commit is contained in:
Maja Frydrychowicz 2015-12-03 15:48:41 -05:00
parent 8a4393dcba
commit 2f6e88a939
5 changed files with 20 additions and 10 deletions

View File

@ -73,6 +73,7 @@ SEARCH_PATHS = [
'testing/xpcshell',
'testing/web-platform',
'testing/web-platform/harness',
'testing/web-platform/tests/tools/wptserve',
'testing/marionette/client',
'testing/marionette/client/marionette/runner/mixins/browsermob-proxy-py',
'testing/marionette/transport',

View File

@ -1,6 +1,7 @@
marionette_transport.pth:testing/marionette/transport
marionette_driver.pth:testing/marionette/driver
browsermobproxy.pth:testing/marionette/client/marionette/runner/mixins/browsermob-proxy-py
wptserve.pth:testing/web-platform/tests/tools/wptserve
marionette.pth:testing/marionette/client
blessings.pth:python/blessings
configobj.pth:python/configobj

View File

@ -1,4 +1,5 @@
-r mozbase_requirements.txt
../tools/wptserve
../marionette/transport
../marionette/driver
../marionette/marionette/runner/mixins/browsermob-proxy-py

View File

@ -4,7 +4,7 @@
import os
from mozhttpd import MozHttpd
from wptserve import server, handlers, routes as default_routes
class FixtureServer(object):
@ -20,8 +20,14 @@ class FixtureServer(object):
def start(self, block=False):
if self.alive:
return
self._server = MozHttpd(host=self.host, port=self.port, docroot=self.root, urlhandlers=[
{"method": "POST", "path": "/file_upload", "function": upload_handler}])
routes = [("POST", "/file_upload", upload_handler)]
routes.extend(default_routes.routes)
self._server = server.WebTestHttpd(
port=self.port,
doc_root=self.root,
routes=routes,
host=self.host,
)
self._server.start(block=block)
self.port = self._server.httpd.server_port
self.base_url = self.get_url()
@ -42,18 +48,19 @@ class FixtureServer(object):
return self._server.get_url(path)
@property
def urlhandlers(self):
return self._server.urlhandlers
def routes(self):
return self._server.router.routes
def upload_handler(query, postdata=None):
return (200, {}, query.headers.getheader("Content-Type"))
@handlers.handler
def upload_handler(request, response):
return 200, [], [request.headers.get("Content-Type")] or []
if __name__ == "__main__":
here = os.path.abspath(os.path.dirname(__file__))
root = os.path.join(os.path.dirname(here), "www")
httpd = FixtureServer(root, port=2829)
doc_root = os.path.join(os.path.dirname(here), "www")
httpd = FixtureServer(doc_root, port=2829)
print "Started fixture server on http://%s:%d/" % (httpd.host, httpd.port)
try:
httpd.start(True)

View File

@ -1,7 +1,7 @@
marionette-driver >= 1.1.1
browsermob-proxy >= 0.6.0
manifestparser >= 1.1
mozhttpd >= 0.7
wptserve >= 1.3.0
mozinfo >= 0.8
mozprocess >= 0.9
mozrunner >= 6.9