Bug 1494043 [wpt PR 13200] - Make wptrunner chrome always use the WebDriver executor, a=testonly
authormoz-wptsync-bot <wptsync@mozilla.com>
Wed, 03 Oct 2018 09:28:16 +0000
changeset 495410 45adcef8d6da3b541dd43595cf489447454ad078
parent 495409 dd9ecb747f9db84eeddeee817f889933c9ff64cd
child 495411 6bb93547b222052b57d18e9ebe7ba03e05fff829
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1494043, 13200
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1494043 [wpt PR 13200] - Make wptrunner chrome always use the WebDriver executor, a=testonly Automatic update from web-platform-testsMake wptrunner chrome always use the WebDriver executor (#13200) -- wpt-commits: 9bc71d422a550c47fedf831355b0709b7fab637c wpt-pr: 13200
testing/web-platform/tests/tools/ci/ci_wptrunner_infrastructure.sh
testing/web-platform/tests/tools/wpt/browser.py
testing/web-platform/tests/tools/wpt/run.py
testing/web-platform/tests/tools/wptrunner/wptrunner/browsers/__init__.py
testing/web-platform/tests/tools/wptrunner/wptrunner/browsers/chrome.py
testing/web-platform/tests/tools/wptrunner/wptrunner/browsers/chrome_webdriver.py
testing/web-platform/tests/tools/wptrunner/wptrunner/tests/base.py
--- a/testing/web-platform/tests/tools/ci/ci_wptrunner_infrastructure.sh
+++ b/testing/web-platform/tests/tools/ci/ci_wptrunner_infrastructure.sh
@@ -13,24 +13,24 @@ test_infrastructure() {
         ARGS="--install-browser"
     else
         ARGS=$1
     fi
     ./wpt run --yes --manifest ~/meta/MANIFEST.json --metadata infrastructure/metadata/ --install-fonts $ARGS $PRODUCT infrastructure/
 }
 
 main() {
-    PRODUCTS=( "firefox" "chrome" "chrome_webdriver" )
+    PRODUCTS=( "firefox" "chrome" )
     for PRODUCT in "${PRODUCTS[@]}"; do
         if [ "$PRODUCT" != "firefox" ]; then
             # Firefox is expected to work using pref settings for DNS
             # Don't adjust the hostnames in that case to ensure this keeps working
             hosts_fixup
         fi
-        if [[ "$PRODUCT" == "chrome"* ]]; then
+        if [[ "$PRODUCT" == "chrome" ]]; then
             install_chrome unstable
             test_infrastructure "--binary=$(which google-chrome-unstable)"
         else
             test_infrastructure
         fi
     done
 }
 
--- a/testing/web-platform/tests/tools/wpt/browser.py
+++ b/testing/web-platform/tests/tools/wpt/browser.py
@@ -497,23 +497,16 @@ class ChromeAndroid(Browser):
 
     def install_webdriver(self, dest=None, channel=None):
         chrome = Chrome()
         return chrome.install_webdriver(dest, channel)
 
     def version(self, binary):
         return None
 
-class ChromeWebDriver(Chrome):
-    """Chrome-specific interface for chrome without using selenium.
-
-    Includes webdriver installation.
-    """
-    product = "chrome_webdriver"
-
 
 class Opera(Browser):
     """Opera-specific interface.
 
     Includes webdriver installation, and wptrunner setup methods.
     """
 
     product = "opera"
--- a/testing/web-platform/tests/tools/wpt/run.py
+++ b/testing/web-platform/tests/tools/wpt/run.py
@@ -294,21 +294,16 @@ class ChromeAndroid(BrowserSetup):
             else:
                 raise WptrunError("Unable to locate or install chromedriver binary")
 
 
 class ChromeWebDriver(Chrome):
     name = "chrome_webdriver"
     browser_cls = browser.ChromeWebDriver
 
-class ChromeWebDriver(Chrome):
-    name = "chrome_webdriver"
-    browser_cls = browser.ChromeWebDriver
-
-
 class Opera(BrowserSetup):
     name = "opera"
     browser_cls = browser.Opera
 
     def setup_kwargs(self, kwargs):
         if kwargs["webdriver_binary"] is None:
             webdriver_binary = self.browser.find_webdriver()
 
@@ -447,17 +442,16 @@ class WebKit(BrowserSetup):
         pass
 
 
 product_setup = {
     "fennec": Fennec,
     "firefox": Firefox,
     "chrome": Chrome,
     "chrome_android": ChromeAndroid,
-    "chrome_webdriver": ChromeWebDriver,
     "edge": Edge,
     "edge_webdriver": EdgeWebDriver,
     "ie": InternetExplorer,
     "safari": Safari,
     "safari_webdriver": SafariWebDriver,
     "servo": Servo,
     "sauce": Sauce,
     "opera": Opera,
--- a/testing/web-platform/tests/tools/wptrunner/wptrunner/browsers/__init__.py
+++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/browsers/__init__.py
@@ -19,17 +19,16 @@ a dictionary with the fields
                arguments passed to the TestEnvironment.
 
 All classes and functions named in the above dict must be imported into the
 module global scope.
 """
 
 product_list = ["chrome",
                 "chrome_android",
-                "chrome_webdriver",
                 "edge",
                 "edge_webdriver",
                 "fennec",
                 "firefox",
                 "ie",
                 "safari",
                 "safari_webdriver",
                 "sauce",
--- a/testing/web-platform/tests/tools/wptrunner/wptrunner/browsers/chrome.py
+++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/browsers/chrome.py
@@ -1,21 +1,21 @@
 from .base import Browser, ExecutorBrowser, require_arg
 from ..webdriver_server import ChromeDriverServer
 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.executorchrome import ChromeDriverWdspecExecutor  # noqa: F401
 
 
 __wptrunner__ = {"product": "chrome",
                  "check_args": "check_args",
                  "browser": "ChromeBrowser",
-                 "executor": {"testharness": "SeleniumTestharnessExecutor",
-                              "reftest": "SeleniumRefTestExecutor",
+                 "executor": {"testharness": "WebDriverTestharnessExecutor",
+                              "reftest": "WebDriverRefTestExecutor",
                               "wdspec": "ChromeDriverWdspecExecutor"},
                  "browser_kwargs": "browser_kwargs",
                  "executor_kwargs": "executor_kwargs",
                  "env_extras": "env_extras",
                  "env_options": "env_options"}
 
 
 def check_args(**kwargs):
@@ -25,44 +25,53 @@ def check_args(**kwargs):
 def browser_kwargs(test_type, run_info_data, config, **kwargs):
     return {"binary": kwargs["binary"],
             "webdriver_binary": kwargs["webdriver_binary"],
             "webdriver_args": kwargs.get("webdriver_args")}
 
 
 def executor_kwargs(test_type, server_config, cache_manager, run_info_data,
                     **kwargs):
-    from selenium.webdriver import DesiredCapabilities
-
     executor_kwargs = base_executor_kwargs(test_type, server_config,
                                            cache_manager, run_info_data,
                                            **kwargs)
     executor_kwargs["close_after_done"] = True
-    capabilities = dict(DesiredCapabilities.CHROME.items())
-    capabilities.setdefault("goog:chromeOptions", {})["prefs"] = {
-        "profile": {
-            "default_content_setting_values": {
-                "popups": 1
-            }
+
+    capabilities = {
+        "browserName": "chrome",
+        "platform": "ANY",
+        "version": "",
+        "goog:chromeOptions": {
+            "prefs": {
+                "profile": {
+                    "default_content_setting_values": {
+                        "popups": 1
+                    }
+                }
+            },
+            "w3c": True
         }
     }
+
     for (kwarg, capability) in [("binary", "binary"), ("binary_args", "args")]:
         if kwargs[kwarg] is not None:
             capabilities["goog:chromeOptions"][capability] = kwargs[kwarg]
+
     if kwargs["headless"]:
         if "args" not in capabilities["goog:chromeOptions"]:
             capabilities["goog:chromeOptions"]["args"] = []
         if "--headless" not in capabilities["goog:chromeOptions"]["args"]:
             capabilities["goog:chromeOptions"]["args"].append("--headless")
+
     if test_type == "testharness":
         capabilities["goog:chromeOptions"]["useAutomationExtension"] = False
         capabilities["goog:chromeOptions"]["excludeSwitches"] = ["enable-automation"]
-    if test_type == "wdspec":
-        capabilities["goog:chromeOptions"]["w3c"] = True
+
     executor_kwargs["capabilities"] = capabilities
+
     return executor_kwargs
 
 
 def env_extras(**kwargs):
     return []
 
 
 def env_options():
deleted file mode 100644
--- a/testing/web-platform/tests/tools/wptrunner/wptrunner/browsers/chrome_webdriver.py
+++ /dev/null
@@ -1,56 +0,0 @@
-from .base import inherit
-from . import chrome
-
-from ..executors import executor_kwargs as base_executor_kwargs
-from ..executors.executorwebdriver import (WebDriverTestharnessExecutor,  # noqa: F401
-                                           WebDriverRefTestExecutor)  # noqa: F401
-
-
-inherit(chrome, globals(), "chrome_webdriver")
-
-# __wptrunner__ magically appears from inherit, F821 is undefined name
-__wptrunner__["executor_kwargs"] = "executor_kwargs"  # noqa: F821
-__wptrunner__["executor"]["testharness"] = "WebDriverTestharnessExecutor"  # noqa: F821
-__wptrunner__["executor"]["reftest"] = "WebDriverRefTestExecutor"  # noqa: F821
-
-
-def executor_kwargs(test_type, server_config, cache_manager, run_info_data,
-                    **kwargs):
-    executor_kwargs = base_executor_kwargs(test_type, server_config,
-                                           cache_manager, run_info_data,
-                                           **kwargs)
-    executor_kwargs["close_after_done"] = True
-
-    capabilities = {
-        "browserName": "chrome",
-        "platform": "ANY",
-        "version": "",
-        "goog:chromeOptions": {
-            "prefs": {
-                "profile": {
-                    "default_content_setting_values": {
-                        "popups": 1
-                    }
-                }
-            },
-            "w3c": True
-        }
-    }
-
-    for (kwarg, capability) in [("binary", "binary"), ("binary_args", "args")]:
-        if kwargs[kwarg] is not None:
-            capabilities["goog:chromeOptions"][capability] = kwargs[kwarg]
-
-    if kwargs["headless"]:
-        if "args" not in capabilities["goog:chromeOptions"]:
-            capabilities["goog:chromeOptions"]["args"] = []
-        if "--headless" not in capabilities["goog:chromeOptions"]["args"]:
-            capabilities["goog:chromeOptions"]["args"].append("--headless")
-
-    if test_type == "testharness":
-        capabilities["goog:chromeOptions"]["useAutomationExtension"] = False
-        capabilities["goog:chromeOptions"]["excludeSwitches"] = ["enable-automation"]
-
-    executor_kwargs["capabilities"] = capabilities
-
-    return executor_kwargs
--- a/testing/web-platform/tests/tools/wptrunner/wptrunner/tests/base.py
+++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/tests/base.py
@@ -12,17 +12,17 @@ from wptrunner import browsers
 
 _products = browsers.product_list
 _active_products = set()
 
 if "CURRENT_TOX_ENV" in os.environ:
     current_tox_env_split = os.environ["CURRENT_TOX_ENV"].split("-")
 
     tox_env_extra_browsers = {
-        "chrome": {"chrome_android", "chrome_webdriver"},
+        "chrome": {"chrome_android"},
         "edge": {"edge_webdriver"},
         "safari": {"safari_webdriver"},
         "servo": {"servodriver"},
     }
 
     _active_products = set(_products) & set(current_tox_env_split)
     for product in frozenset(_active_products):
         _active_products |= tox_env_extra_browsers.get(product, set())