Bug 1470357 [wpt PR 11615] - webkit: GTK port should whitelist the web-platform.test host certificate, a=testonly

Automatic update from web-platform-testswebkit: GTK port should whitelist the web-platform.test host certificate (#11615)

For testing purposes, the TLS certificate for the web-platform.test
host should be whitelisted for the GTK port of WebKit in order to
avoid TLS errors when loading test cases via HTTPS.

This is done by listing the host and certificate file path pair in
the port-specific capabilities. This pair is then used for
whitelisting the certificate for the given host in the
WebDriver-automated browsing session.
--

wpt-commits: cc6c95d405d3a89ace8a0565a04eee23e24af814
wpt-pr: 11615
This commit is contained in:
Žan Doberšek 2018-07-06 22:45:02 +00:00 committed by James Graham
parent bb6e189d7d
commit d82ed22876

View File

@ -30,14 +30,18 @@ def browser_kwargs(test_type, run_info_data, **kwargs):
"webdriver_args": kwargs.get("webdriver_args")}
def capabilities_for_port(webkit_port, binary, binary_args):
def capabilities_for_port(server_config, **kwargs):
from selenium.webdriver import DesiredCapabilities
if webkit_port == "gtk":
if kwargs["webkit_port"] == "gtk":
capabilities = dict(DesiredCapabilities.WEBKITGTK.copy())
capabilities["webkitgtk:browserOptions"] = {
"binary": binary,
"args": binary_args
"binary": kwargs["binary"],
"args": kwargs.get("binary_args", []),
"certificates": [
{"host": server_config["browser_host"],
"certificateFile": kwargs["host_cert_path"]}
]
}
return capabilities
@ -49,10 +53,8 @@ def executor_kwargs(test_type, server_config, cache_manager, run_info_data,
executor_kwargs = base_executor_kwargs(test_type, server_config,
cache_manager, run_info_data, **kwargs)
executor_kwargs["close_after_done"] = True
capabilities = capabilities_for_port(kwargs["webkit_port"],
kwargs["binary"],
kwargs.get("binary_args", []))
executor_kwargs["capabilities"] = capabilities
executor_kwargs["capabilities"] = capabilities_for_port(server_config,
**kwargs)
return executor_kwargs