Bug 1495328 [wpt PR 13277] - Enable WebDriver executor by default for Chrome, a=testonly
authormoz-wptsync-bot <wptsync@mozilla.com>
Fri, 05 Oct 2018 14:22:49 +0000
changeset 440044 12247e095264fd699d5ce8590b61f9b92b4a3692
parent 440043 5dfd65c8b93d7a9cb84918e2eed50e4fccd81ba7
child 440045 7aa18f37ba68f29b2eefe3772eed623de154ed4e
push id108725
push userwptsync@mozilla.com
push dateMon, 08 Oct 2018 16:48:05 +0000
treeherdermozilla-inbound@af3fd1f92628 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1495328, 13277
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 1495328 [wpt PR 13277] - Enable WebDriver executor by default for Chrome, a=testonly Automatic update from web-platform-testsUnknown executor exceptions need be INTERNAL-ERROR -- Make wptrunner chrome always use the WebDriver executor -- wpt-commits: 40421ff058cbf8020878bcb096bf604d1c450aec, caf4aa367efef641c4b0e5dfd1c8970eb102f060 wpt-pr: 13277
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/executors/executorwebdriver.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
@@ -498,23 +498,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"
     requirements = "requirements_opera.txt"
--- 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/executors/executorwebdriver.py
+++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/executors/executorwebdriver.py
@@ -246,17 +246,17 @@ class WebDriverRun(object):
                     e.status_code == "asynchronous script timeout"):
                 # workaround for https://bugs.chromium.org/p/chromedriver/issues/detail?id=2001
                 self.result = False, ("EXTERNAL-TIMEOUT", None)
             else:
                 message = getattr(e, "message", "")
                 if message:
                     message += "\n"
                 message += traceback.format_exc(e)
-                self.result = False, ("ERROR", message)
+                self.result = False, ("INTERNAL-ERROR", message)
         finally:
             self.result_flag.set()
 
 
 class WebDriverTestharnessExecutor(TestharnessExecutor):
     supports_testdriver = True
 
     def __init__(self, browser, server_config, timeout_multiplier=1,
--- 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())