mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-09 04:37:52 +03:00
WPT: Update to latest master and remove unnecessary patch
This commit is contained in:
parent
4522c82459
commit
5a334ae958
Notes:
sideshowbarker
2024-07-17 02:28:18 +09:00
Author: https://github.com/ADKaster Commit: https://github.com/SerenityOS/serenity/commit/5a334ae958 Pull-request: https://github.com/SerenityOS/serenity/pull/21563 Reviewed-by: https://github.com/kalenikaliaksandr ✅
@ -1,149 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
|
||||
Date: Sat, 19 Aug 2023 17:06:27 -0600
|
||||
Subject: [PATCH] Add Ladybird WebDriver runner
|
||||
|
||||
Co-Authored-By: Andrew Kaster <akaster@serenityos.org>
|
||||
---
|
||||
tools/wpt/browser.py | 21 ++++++++
|
||||
tools/wpt/run.py | 12 ++++-
|
||||
.../wptrunner/wptrunner/browsers/__init__.py | 3 +-
|
||||
.../wptrunner/wptrunner/browsers/ladybird.py | 49 +++++++++++++++++++
|
||||
4 files changed, 83 insertions(+), 2 deletions(-)
|
||||
create mode 100644 tools/wptrunner/wptrunner/browsers/ladybird.py
|
||||
|
||||
diff --git a/tools/wpt/browser.py b/tools/wpt/browser.py
|
||||
index 5e8bfdab160137cab305c8f124195724deddc069..c57f5db26f1275a899413276a9518517d2ee07ff 100644
|
||||
--- a/tools/wpt/browser.py
|
||||
+++ b/tools/wpt/browser.py
|
||||
@@ -1918,6 +1918,27 @@ class WebKit(Browser):
|
||||
def version(self, binary=None, webdriver_binary=None):
|
||||
return None
|
||||
|
||||
+class Ladybird(Browser):
|
||||
+ product = "ladybird"
|
||||
+ requirements = None
|
||||
+
|
||||
+ def download(self, dest=None, channel=None, rename=None):
|
||||
+ raise NotImplementedError
|
||||
+
|
||||
+ def install(self, dest=None, channel=None):
|
||||
+ raise NotImplementedError
|
||||
+
|
||||
+ def find_binary(self, venv_path=None, channel=None):
|
||||
+ return which("ladybird")
|
||||
+
|
||||
+ def find_webdriver(self, venv_path=None, channel=None):
|
||||
+ return which("WebDriver")
|
||||
+
|
||||
+ def install_webdriver(self, dest=None, channel=None, browser_binary=None):
|
||||
+ raise NotImplementedError
|
||||
+
|
||||
+ def version(self, binary=None, webdriver_binary=None):
|
||||
+ return None
|
||||
|
||||
class WebKitTestRunner(Browser):
|
||||
"""Interface for WebKitTestRunner.
|
||||
diff --git a/tools/wpt/run.py b/tools/wpt/run.py
|
||||
index 15be2af2d3d7a969910deb3a83365c733354dd1e..9faed6b737ca26b49d64c7aed517b76a995a1d6c 100644
|
||||
--- a/tools/wpt/run.py
|
||||
+++ b/tools/wpt/run.py
|
||||
@@ -110,7 +110,7 @@ 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",
|
||||
- "firefox", "firefox_android", "servo", "wktr"):
|
||||
+ "firefox", "firefox_android", "servo", "wktr", "ladybird"):
|
||||
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"}
|
||||
@@ -692,6 +692,15 @@ class WebKit(BrowserSetup):
|
||||
def setup_kwargs(self, kwargs):
|
||||
pass
|
||||
|
||||
+class Ladybird(BrowserSetup):
|
||||
+ name = "ladybird"
|
||||
+ browser_cls = browser.Ladybird
|
||||
+
|
||||
+ def install(self, channel=None):
|
||||
+ raise NotImplementedError
|
||||
+
|
||||
+ def setup_kwargs(self, kwargs):
|
||||
+ pass
|
||||
|
||||
class WebKitTestRunner(BrowserSetup):
|
||||
name = "wktr"
|
||||
@@ -782,6 +791,7 @@ product_setup = {
|
||||
"wktr": WebKitTestRunner,
|
||||
"webkitgtk_minibrowser": WebKitGTKMiniBrowser,
|
||||
"epiphany": Epiphany,
|
||||
+ "ladybird": Ladybird
|
||||
}
|
||||
|
||||
|
||||
diff --git a/tools/wptrunner/wptrunner/browsers/__init__.py b/tools/wptrunner/wptrunner/browsers/__init__.py
|
||||
index 9724bb957b5e3c7d1a9e1506c7e710742038c916..4d10457699d5abd9e1cb5e02a2b58e825be1b417 100644
|
||||
--- a/tools/wptrunner/wptrunner/browsers/__init__.py
|
||||
+++ b/tools/wptrunner/wptrunner/browsers/__init__.py
|
||||
@@ -43,4 +43,5 @@ product_list = ["android_weblayer",
|
||||
"webkit",
|
||||
"webkitgtk_minibrowser",
|
||||
"wktr",
|
||||
- "epiphany"]
|
||||
+ "epiphany",
|
||||
+ "ladybird"]
|
||||
diff --git a/tools/wptrunner/wptrunner/browsers/ladybird.py b/tools/wptrunner/wptrunner/browsers/ladybird.py
|
||||
new file mode 100644
|
||||
index 0000000000000000000000000000000000000000..5c9e68e4719a3b59e14f745c49a64604bee3b940
|
||||
--- /dev/null
|
||||
+++ b/tools/wptrunner/wptrunner/browsers/ladybird.py
|
||||
@@ -0,0 +1,49 @@
|
||||
+from .base import WebDriverBrowser, require_arg
|
||||
+from .base import get_timeout_multiplier
|
||||
+from ..executors import executor_kwargs as base_executor_kwargs
|
||||
+from ..executors.executorwebdriver import (WebDriverTestharnessExecutor, # noqa: F401
|
||||
+ WebDriverRefTestExecutor, # noqa: F401
|
||||
+ WebDriverCrashtestExecutor) # noqa: F401
|
||||
+from ..executors.base import WdspecExecutor
|
||||
+
|
||||
+__wptrunner__ = {
|
||||
+ "product": "ladybird",
|
||||
+ "check_args": "check_args",
|
||||
+ "browser": "LadybirdBrowser",
|
||||
+ "browser_kwargs": "browser_kwargs",
|
||||
+ "executor_kwargs": "executor_kwargs",
|
||||
+ "env_options": "env_options",
|
||||
+ "env_extras": "env_extras",
|
||||
+ "timeout_multiplier": "get_timeout_multiplier",
|
||||
+ "executor": {
|
||||
+ # "testharness": "WebDriverTestharnessExecutor",
|
||||
+ "reftest": "WebDriverRefTestExecutor",
|
||||
+ # "wdspec": "WdspecExecutor",
|
||||
+ # "crashtest": "WebDriverCrashtestExecutor"
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+def check_args(**kwargs):
|
||||
+ require_arg(kwargs, "webdriver_binary")
|
||||
+
|
||||
+
|
||||
+def browser_kwargs(logger, 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(logger, test_type, test_environment, run_info_data,
|
||||
+ **kwargs):
|
||||
+ executor_kwargs = base_executor_kwargs(test_type, test_environment, run_info_data, **kwargs)
|
||||
+ executor_kwargs["capabilities"] = {}
|
||||
+ return executor_kwargs
|
||||
+
|
||||
+def env_options():
|
||||
+ return {}
|
||||
+
|
||||
+def env_extras(**kwargs):
|
||||
+ return []
|
||||
+
|
||||
+class LadybirdBrowser(WebDriverBrowser):
|
||||
+ def make_command(self):
|
||||
+ return [self.webdriver_binary, "--port", str(self.port)] + self.webdriver_args
|
@ -15,8 +15,6 @@ WEBDRIVER_BINARY=$(env PATH="${SERENITY_SOURCE_DIR}/Build/lagom/bin:${SERENITY_S
|
||||
which WebDriver)
|
||||
update_expectations_metadata=false
|
||||
|
||||
dev=0
|
||||
|
||||
for arg in "$@"; do
|
||||
case $arg in
|
||||
--webdriver-binary=*)
|
||||
@ -27,10 +25,6 @@ for arg in "$@"; do
|
||||
update_expectations_metadata=true
|
||||
shift
|
||||
;;
|
||||
--dev)
|
||||
dev=1
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
echo "Unknown argument ${arg}"
|
||||
exit 1
|
||||
@ -50,14 +44,7 @@ if [ ! -d "${SCRIPT_DIR}/wpt" ]; then
|
||||
git clone --depth 10000 https://github.com/web-platform-tests/wpt.git
|
||||
|
||||
# Switch to the commit that was used to generate tests expectations. Requires periodic updates.
|
||||
git -C wpt checkout 4434e91bd0801dfefff044b5b9a9744e30d255d3
|
||||
|
||||
# Apply WPT patch with Ladybird runner
|
||||
if [ "$dev" = "1" ]; then
|
||||
git -C wpt am ../Add-Ladybird-WebDriver-runner.patch > /dev/null
|
||||
else
|
||||
patch -d wpt -p1 < Add-Ladybird-WebDriver-runner.patch > /dev/null
|
||||
fi
|
||||
git -C wpt checkout eedf737ce39c512d0ca3471f988972e3ece11822
|
||||
|
||||
# Update hosts file if needed
|
||||
if [ "$(comm -13 <(sort -u /etc/hosts) <(python3 ./wpt/wpt make-hosts-file | sort -u) | wc -l)" -gt 0 ]; then
|
||||
|
Loading…
Reference in New Issue
Block a user