Bug 1372595 - Let resource URL protocol be configurable; r=jgraham draft
authorAndreas Tolfsen <ato@mozilla.com>
Tue, 13 Jun 2017 16:37:38 +0100
changeset 602403 3045dffd2c5c1ec5837b75252a4b148a5cc6e2b0
parent 602297 d9a144b7b6d994fc9a497c53b13f51a2a654d85e
child 602404 0df947287b5950e35b4aa4a5c22c0ef9648886aa
push id66423
push userbmo:ato@sny.no
push dateThu, 29 Jun 2017 23:57:19 +0000
reviewersjgraham
bugs1372595
milestone56.0a1
Bug 1372595 - Let resource URL protocol be configurable; r=jgraham The url fixture is used to access hosted files on the wptserve instance. This patch makes it possible to choose between different wptserve HTTPDs based on the protocol. The default remains the HTTP protocol. MozReview-Commit-ID: FvtMMUSlB4M
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/webdriver/support/fixtures.py
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -220636,17 +220636,17 @@
    "5a31a3917a5157516c10951a3b3d5ffb43b992d9",
    "support"
   ],
   "webdriver/support/asserts.py": [
    "68bde3a7b3e3fe3ecd45e43c9fbc3c1317828e08",
    "support"
   ],
   "webdriver/support/fixtures.py": [
-   "6e3aa3d4ba89b4acd2e18af60ad1d7034b2a4e5f",
+   "82f0f3b1c668040fa7a0187f00501a2b0f2e2565",
    "support"
   ],
   "webdriver/support/http_request.py": [
    "01c4b525c27f77d253c75031a9cee3f17aca8df0",
    "support"
   ],
   "webdriver/support/inline.py": [
    "bc85126e5637145e81f27d037f3a9090747130c8",
--- a/testing/web-platform/tests/webdriver/support/fixtures.py
+++ b/testing/web-platform/tests/webdriver/support/fixtures.py
@@ -167,17 +167,14 @@ def new_session(configuration, request):
 
     end()
     request.addfinalizer(end)
 
     return create_session
 
 
 def url(server_config):
-    def inner(path, query="", fragment=""):
-        rv = urlparse.urlunsplit(("http",
-                                  "%s:%s" % (server_config["host"],
-                                             server_config["ports"]["http"][0]),
-                                  path,
-                                  query,
-                                  fragment))
-        return rv
+    def inner(path, protocol="http", query="", fragment=""):
+        port = server_config["ports"][protocol][0]
+        host = "%s:%s" % (server_config["host"], port)
+        return urlparse.urlunsplit((protocol, host, path, query, fragment))
+
     return inner