From 54fd6a1ee1ef05b049def74525f2e064ab9ab705 Mon Sep 17 00:00:00 2001 From: Zan Dobersek Date: Wed, 3 Oct 2018 16:19:01 +0200 Subject: [PATCH 1/3] Switch WebKit browser product to WebDriver executors Switch away from Selenium executors to WebDriverTestharnessExecutor and WebDriverRefTestExecutor for the WebKit browser product. For the moment this requires manually mapping Selenium-style capability names to the W3C equivalents that can be handled by WebKit's WebDriver implementation. The browserVersion value is also hard-coded to the 2.20 release series for the GTK+ port of WebKit as that's when the WebDriver functionality was introduced. --- tools/wptrunner/wptrunner/browsers/webkit.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/tools/wptrunner/wptrunner/browsers/webkit.py b/tools/wptrunner/wptrunner/browsers/webkit.py index 9482f2f7743324..5bb7f9c4b19aca 100644 --- a/tools/wptrunner/wptrunner/browsers/webkit.py +++ b/tools/wptrunner/wptrunner/browsers/webkit.py @@ -1,7 +1,7 @@ from .base import Browser, ExecutorBrowser, require_arg from ..executors import executor_kwargs as base_executor_kwargs -from ..executors.executorselenium import (SeleniumTestharnessExecutor, # noqa: F401 - SeleniumRefTestExecutor) # noqa: F401 +from ..executors.executorwebdriver import (WebDriverTestharnessExecutor, # noqa: F401 + WebDriverRefTestExecutor) # noqa: F401 from ..executors.executorwebkit import WebKitDriverWdspecExecutor # noqa: F401 from ..webdriver_server import WebKitDriverServer @@ -10,8 +10,8 @@ "check_args": "check_args", "browser": "WebKitBrowser", "browser_kwargs": "browser_kwargs", - "executor": {"testharness": "SeleniumTestharnessExecutor", - "reftest": "SeleniumRefTestExecutor", + "executor": {"testharness": "WebDriverTestharnessExecutor", + "reftest": "WebDriverRefTestExecutor", "wdspec": "WebKitDriverWdspecExecutor"}, "executor_kwargs": "executor_kwargs", "env_extras": "env_extras", @@ -43,6 +43,16 @@ def capabilities_for_port(server_config, **kwargs): "certificateFile": kwargs["host_cert_path"]} ] } + + # Manually map Selenium's key names to the corresponding W3C versions. + if capabilities.has_key("platform"): + capabilities["platformName"] = capabilities.pop("platform") + if capabilities.has_key("version"): + capabilities["browserVersion"] = capabilities.pop("version") + + # Force the 2.x release series to be used as the required version. + capabilities["browserVersion"] = "2.0.0" + return capabilities return {} From aed526b171adf62e84260fe98bba8200f745cd2c Mon Sep 17 00:00:00 2001 From: Zan Dobersek Date: Wed, 3 Oct 2018 16:41:09 +0200 Subject: [PATCH 2/3] Actually use the 2.20 release series as browserVersion value. --- tools/wptrunner/wptrunner/browsers/webkit.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/wptrunner/wptrunner/browsers/webkit.py b/tools/wptrunner/wptrunner/browsers/webkit.py index 5bb7f9c4b19aca..c80046dd258d84 100644 --- a/tools/wptrunner/wptrunner/browsers/webkit.py +++ b/tools/wptrunner/wptrunner/browsers/webkit.py @@ -50,8 +50,8 @@ def capabilities_for_port(server_config, **kwargs): if capabilities.has_key("version"): capabilities["browserVersion"] = capabilities.pop("version") - # Force the 2.x release series to be used as the required version. - capabilities["browserVersion"] = "2.0.0" + # Force the 2.20 release series to be used as the required version. + capabilities["browserVersion"] = "2.20" return capabilities From 859173db16885ef09acbbacd7d6fde20f1bdc1c8 Mon Sep 17 00:00:00 2001 From: Zan Dobersek Date: Wed, 3 Oct 2018 16:51:35 +0200 Subject: [PATCH 3/3] Write out WebKitGTK+ capability dict instead of retrieving it from Selenium. --- tools/wptrunner/wptrunner/browsers/webkit.py | 31 ++++++++------------ 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/tools/wptrunner/wptrunner/browsers/webkit.py b/tools/wptrunner/wptrunner/browsers/webkit.py index c80046dd258d84..b09114a9a54447 100644 --- a/tools/wptrunner/wptrunner/browsers/webkit.py +++ b/tools/wptrunner/wptrunner/browsers/webkit.py @@ -31,28 +31,21 @@ def browser_kwargs(test_type, run_info_data, config, **kwargs): def capabilities_for_port(server_config, **kwargs): - from selenium.webdriver import DesiredCapabilities - if kwargs["webkit_port"] == "gtk": - capabilities = dict(DesiredCapabilities.WEBKITGTK.copy()) - capabilities["webkitgtk:browserOptions"] = { - "binary": kwargs["binary"], - "args": kwargs.get("binary_args", []), - "certificates": [ - {"host": server_config["browser_host"], - "certificateFile": kwargs["host_cert_path"]} - ] + capabilities = { + "browserName": "MiniBrowser", + "browserVersion": "2.20", + "platformName": "ANY", + "webkitgtk:browserOptions": { + "binary": kwargs["binary"], + "args": kwargs.get("binary_args", []), + "certificates": [ + {"host": server_config["browser_host"], + "certificateFile": kwargs["host_cert_path"]} + ] + } } - # Manually map Selenium's key names to the corresponding W3C versions. - if capabilities.has_key("platform"): - capabilities["platformName"] = capabilities.pop("platform") - if capabilities.has_key("version"): - capabilities["browserVersion"] = capabilities.pop("version") - - # Force the 2.20 release series to be used as the required version. - capabilities["browserVersion"] = "2.20" - return capabilities return {}