diff options
Diffstat (limited to 'testing/web-platform/tests/tools/wpt')
8 files changed, 30 insertions, 50 deletions
diff --git a/testing/web-platform/tests/tools/wpt/browser.py b/testing/web-platform/tests/tools/wpt/browser.py index ea71499ec4..4c42ffa4e8 100644 --- a/testing/web-platform/tests/tools/wpt/browser.py +++ b/testing/web-platform/tests/tools/wpt/browser.py @@ -1452,7 +1452,7 @@ class ChromeAndroidBase(Browser): if browser_binary is None: browser_binary = self.find_binary(channel) chrome = Chrome(self.logger) - return chrome.install_webdriver_by_version(self.version(browser_binary), dest) + return chrome.install_webdriver_by_version(self.version(browser_binary), dest, channel) def version(self, binary=None, webdriver_binary=None): if not binary: @@ -1489,20 +1489,6 @@ class ChromeAndroid(ChromeAndroidBase): return "com.android.chrome" -# TODO(aluo): This is largely copied from the AndroidWebView implementation. -# Tests are not running for weblayer yet (crbug/1019521), this initial -# implementation will help to reproduce and debug any issues. -class AndroidWeblayer(ChromeAndroidBase): - """Weblayer-specific interface for Android.""" - - product = "android_weblayer" - # TODO(aluo): replace this with weblayer version after tests are working. - requirements = "requirements_chromium.txt" - - def find_binary(self, venv_path=None, channel=None): - return "org.chromium.weblayer.shell" - - class AndroidWebview(ChromeAndroidBase): """Webview-specific interface for Android. @@ -1656,10 +1642,10 @@ class Opera(Browser): return m.group(0) -class EdgeChromium(Browser): +class Edge(Browser): """Microsoft Edge Chromium Browser class.""" - product = "edgechromium" + product = "edge" requirements = "requirements_chromium.txt" platform = { "Linux": "linux", diff --git a/testing/web-platform/tests/tools/wpt/install.py b/testing/web-platform/tests/tools/wpt/install.py index 382c1e2eb8..1e6408b0be 100644 --- a/testing/web-platform/tests/tools/wpt/install.py +++ b/testing/web-platform/tests/tools/wpt/install.py @@ -4,14 +4,13 @@ import argparse from . import browser latest_channels = { - 'android_weblayer': 'dev', 'android_webview': 'dev', 'firefox': 'nightly', 'firefox_android': 'nightly', 'chrome': 'canary', 'chrome_android': 'dev', 'chromium': 'nightly', - 'edgechromium': 'dev', + 'edge': 'dev', 'safari': 'preview', 'servo': 'nightly', 'webkitgtk_minibrowser': 'nightly', diff --git a/testing/web-platform/tests/tools/wpt/requirements_android.txt b/testing/web-platform/tests/tools/wpt/requirements_android.txt index 17672383cb..e8205caa70 100644 --- a/testing/web-platform/tests/tools/wpt/requirements_android.txt +++ b/testing/web-platform/tests/tools/wpt/requirements_android.txt @@ -1 +1 @@ -mozrunner==8.3.0 +mozrunner==8.3.1 diff --git a/testing/web-platform/tests/tools/wpt/requirements_install.txt b/testing/web-platform/tests/tools/wpt/requirements_install.txt index 55bed99f8c..f7df06548c 100644 --- a/testing/web-platform/tests/tools/wpt/requirements_install.txt +++ b/testing/web-platform/tests/tools/wpt/requirements_install.txt @@ -1,2 +1,2 @@ mozinstall==2.1.0 -packaging==23.1 +packaging==24.0 diff --git a/testing/web-platform/tests/tools/wpt/run.py b/testing/web-platform/tests/tools/wpt/run.py index b9db082517..c84cdb442a 100644 --- a/testing/web-platform/tests/tools/wpt/run.py +++ b/testing/web-platform/tests/tools/wpt/run.py @@ -111,10 +111,9 @@ otherwise install OpenSSL and ensure that it's on your $PATH.""") def check_environ(product): - if product not in ("android_weblayer", "android_webview", "chrome", - "chrome_android", "chrome_ios", "content_shell", - "edgechromium", "firefox", "firefox_android", "ladybird", "servo", - "wktr"): + if product not in ("android_webview", "chrome", "chrome_android", "chrome_ios", + "content_shell", "edge", "firefox", "firefox_android", + "ladybird", "servo", "wktr"): config_builder = serve.build_config(os.path.join(wpt_root, "config.json")) # Override the ports to avoid looking for free ports config_builder.ssl = {"type": "none"} @@ -568,6 +567,8 @@ class ChromeAndroidBase(BrowserSetup): if kwargs["package_name"] is None: kwargs["package_name"] = self.browser.find_binary( channel=browser_channel) + if not kwargs["device_serial"]: + kwargs["device_serial"] = ["emulator-5554"] if kwargs["webdriver_binary"] is None: webdriver_binary = None if not kwargs["install_webdriver"]: @@ -615,17 +616,6 @@ class ChromeiOS(BrowserSetup): raise WptrunError("Unable to locate or install chromedriver binary") -class AndroidWeblayer(ChromeAndroidBase): - name = "android_weblayer" - browser_cls = browser.AndroidWeblayer - - def setup_kwargs(self, kwargs): - super().setup_kwargs(kwargs) - if kwargs["browser_channel"] in self.experimental_channels and kwargs["enable_experimental"] is None: - logger.info("Automatically turning on experimental features for WebLayer Dev/Canary") - kwargs["enable_experimental"] = True - - class AndroidWebview(ChromeAndroidBase): name = "android_webview" browser_cls = browser.AndroidWebview @@ -663,9 +653,9 @@ class Opera(BrowserSetup): raise WptrunError("Unable to locate or install operadriver binary") -class EdgeChromium(BrowserSetup): +class Edge(BrowserSetup): name = "MicrosoftEdge" - browser_cls = browser.EdgeChromium + browser_cls = browser.Edge experimental_channels: ClassVar[Tuple[str, ...]] = ("dev", "canary") def setup_kwargs(self, kwargs): @@ -872,7 +862,6 @@ class Epiphany(BrowserSetup): product_setup = { - "android_weblayer": AndroidWeblayer, "android_webview": AndroidWebview, "firefox": Firefox, "firefox_android": FirefoxAndroid, @@ -881,7 +870,7 @@ product_setup = { "chrome_ios": ChromeiOS, "chromium": Chromium, "content_shell": ContentShell, - "edgechromium": EdgeChromium, + "edge": Edge, "safari": Safari, "servo": Servo, "servodriver": ServoWebDriver, @@ -924,6 +913,9 @@ def setup_wptrunner(venv, **kwargs): args_general(kwargs) if kwargs["product"] not in product_setup: + if kwargs["product"] == "edgechromium": + raise WptrunError("edgechromium has been renamed to edge.") + raise WptrunError("Unsupported product %s" % kwargs["product"]) setup_cls = product_setup[kwargs["product"]](venv, kwargs["prompt"]) diff --git a/testing/web-platform/tests/tools/wpt/tests/test_browser.py b/testing/web-platform/tests/tools/wpt/tests/test_browser.py index 95094e376d..3a45dab16e 100644 --- a/testing/web-platform/tests/tools/wpt/tests/test_browser.py +++ b/testing/web-platform/tests/tools/wpt/tests/test_browser.py @@ -30,33 +30,33 @@ def test_all_browser_abc(): assert not inspect.isabstract(cls), "%s is abstract" % name -def test_edgechromium_webdriver_supports_browser(): +def test_edge_webdriver_supports_browser(): # MSEdgeDriver binary cannot be called. - edge = browser.EdgeChromium(logger) + edge = browser.Edge(logger) edge.webdriver_version = mock.MagicMock(return_value=None) assert not edge.webdriver_supports_browser('/usr/bin/edgedriver', '/usr/bin/edge', 'stable') # Browser binary cannot be called. - edge = browser.EdgeChromium(logger) + edge = browser.Edge(logger) edge.webdriver_version = mock.MagicMock(return_value='70.0.1') edge.version = mock.MagicMock(return_value=None) assert edge.webdriver_supports_browser('/usr/bin/edgedriver', '/usr/bin/edge', 'stable') # Browser version matches. - edge = browser.EdgeChromium(logger) + edge = browser.Edge(logger) # Versions should be an exact match to be compatible. edge.webdriver_version = mock.MagicMock(return_value='70.1.5') edge.version = mock.MagicMock(return_value='70.1.5') assert edge.webdriver_supports_browser('/usr/bin/edgedriver', '/usr/bin/edge', 'stable') # Browser version doesn't match. - edge = browser.EdgeChromium(logger) + edge = browser.Edge(logger) edge.webdriver_version = mock.MagicMock(return_value='70.0.1') edge.version = mock.MagicMock(return_value='69.0.1') assert not edge.webdriver_supports_browser('/usr/bin/edgedriver', '/usr/bin/edge', 'stable') # MSEdgeDriver version should match for MAJOR.MINOR.BUILD version. - edge = browser.EdgeChromium(logger) + edge = browser.Edge(logger) edge.webdriver_version = mock.MagicMock(return_value='70.0.1.0') edge.version = mock.MagicMock(return_value='70.0.1.1 dev') assert edge.webdriver_supports_browser('/usr/bin/edgedriver', '/usr/bin/edge', 'dev') @@ -68,8 +68,8 @@ def test_edgechromium_webdriver_supports_browser(): # logic to test there. @pytest.mark.skipif(sys.platform.startswith('win'), reason='just uses _get_fileversion on Windows') @mock.patch('tools.wpt.browser.call') -def test_edgechromium_webdriver_version(mocked_call): - edge = browser.EdgeChromium(logger) +def test_edge_webdriver_version(mocked_call): + edge = browser.Edge(logger) webdriver_binary = '/usr/bin/edgedriver' # Working cases. diff --git a/testing/web-platform/tests/tools/wpt/tox.ini b/testing/web-platform/tests/tools/wpt/tox.ini index 4068f70898..b6e3dab231 100644 --- a/testing/web-platform/tests/tools/wpt/tox.ini +++ b/testing/web-platform/tests/tools/wpt/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py37,py38,py39,py310,py311 +envlist = py38,py39,py310,py311,py312 skipsdist=True skip_missing_interpreters = False diff --git a/testing/web-platform/tests/tools/wpt/utils.py b/testing/web-platform/tests/tools/wpt/utils.py index 5899dc3f3a..51bb3f55dc 100644 --- a/testing/web-platform/tests/tools/wpt/utils.py +++ b/testing/web-platform/tests/tools/wpt/utils.py @@ -46,8 +46,11 @@ def untar(fileobj, dest="."): """Extract tar archive.""" logger.debug("untar") fileobj = seekable(fileobj) + kwargs = {} + if sys.version_info.major >= 3 and sys.version_info.minor >= 12: + kwargs["filter"] = "tar" with tarfile.open(fileobj=fileobj) as tar_data: - tar_data.extractall(path=dest) + tar_data.extractall(path=dest, **kwargs) def unzip(fileobj, dest=None, limit=None): |