Enable wdspec and crashtest tests in servodriver. (#34955)

Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
Josh Matthews 2025-01-12 03:23:26 -05:00 committed by GitHub
parent 2115b6a6db
commit 0c0ffefb48
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 27 additions and 5 deletions

View file

@ -93,7 +93,7 @@ def run_tests(default_binary_path: str, **kwargs):
if not kwargs.get("no_default_test_types"):
test_types = {
"servo": ["testharness", "reftest", "wdspec", "crashtest"],
"servodriver": ["testharness", "reftest"],
"servodriver": ["testharness", "reftest", "wdspec", "crashtest"],
}
product = kwargs.get("product") or "servo"
kwargs["test_types"] = test_types[product]

View file

@ -503811,7 +503811,7 @@
[]
],
"servodriver.py": [
"d3cc341babecb750ad55862997e52efcdc4c7491",
"f8f50537740eea0c169af68becd42c8bc22ae0f7",
[]
],
"webkit.py": [
@ -503877,7 +503877,7 @@
[]
],
"executorservodriver.py": [
"41b8ed9ac1891edb7ec332c61923314f8b1e5f19",
"7e4aee5e7af7b9719b4ccb1f5a0a7c7cb3aa1653",
[]
],
"executorwebdriver.py": [

View file

@ -10,8 +10,10 @@ from .base import (WebDriverBrowser,
get_free_port)
from .base import get_timeout_multiplier # noqa: F401
from ..executors import executor_kwargs as base_executor_kwargs
from ..executors.base import WdspecExecutor # noqa: F401
from ..executors.executorservodriver import (ServoWebDriverTestharnessExecutor, # noqa: F401
ServoWebDriverRefTestExecutor) # noqa: F401
ServoWebDriverRefTestExecutor, # noqa: F401
ServoWebDriverCrashtestExecutor) # noqa: F401
here = os.path.dirname(__file__)
@ -22,6 +24,8 @@ __wptrunner__ = {
"executor": {
"testharness": "ServoWebDriverTestharnessExecutor",
"reftest": "ServoWebDriverRefTestExecutor",
"crashtest": "ServoWebDriverCrashtestExecutor",
"wdspec": "WdspecExecutor",
},
"browser_kwargs": "browser_kwargs",
"executor_kwargs": "executor_kwargs",

View file

@ -2,7 +2,7 @@
import os
from .executorwebdriver import WebDriverProtocol, WebDriverTestharnessExecutor, WebDriverRefTestExecutor
from .executorwebdriver import WebDriverProtocol, WebDriverTestharnessExecutor, WebDriverRefTestExecutor, WebDriverCrashtestExecutor
webdriver = None
ServoCommandExtensions = None
@ -108,3 +108,21 @@ class ServoWebDriverRefTestExecutor(WebDriverRefTestExecutor):
self.last_environment.get("prefs", {}),
new_environment.get("prefs", {})
)
class ServoWebDriverCrashtestExecutor(WebDriverCrashtestExecutor):
protocol_cls = ServoWebDriverProtocol
def __init__(self, logger, browser, server_config, timeout_multiplier=1,
screenshot_cache=None, capabilities={}, debug_info=None,
**kwargs):
WebDriverCrashtestExecutor.__init__(self, logger, browser, server_config,
timeout_multiplier, screenshot_cache,
capabilities=capabilities,
debug_info=debug_info)
def on_environment_change(self, new_environment):
self.protocol.webdriver.extension.change_prefs(
self.last_environment.get("prefs", {}),
new_environment.get("prefs", {})
)