servo/ports/servoshell
shuppy cfa9e711c5
webdriver: Use take_screenshot() API in Take (Element) Screenshot (#39587)
WPT tests require us to reliably take screenshots when test pages are
fully loaded and testing is complete, and the WPT runner uses
[test-wait.js](a2f551eb2d/tests/wpt/tests/tools/wptrunner/wptrunner/executors/test-wait.js)
to do this in userland. when testing Servo with [--product
servo](a2f551eb2d/tests/wpt/tests/tools/wptrunner/wptrunner/executors/executorservo.py),
we use servoshell’s --output option, which backs that up with more
reliable waiting in Servo. but when testing Servo with [--product
servodriver](a2f551eb2d/tests/wpt/tests/tools/wptrunner/wptrunner/executors/executorservodriver.py),
we use the WebDriver Take Screenshot action, which currently takes the
screenshot immediately. we think this might be a source of regressions.

this patch makes the WebDriver actions Take Screenshot and Take Element
Screenshot use the same new WebView::take_screenshot() API as
servoshell’s --output option, such that those actions now wait for [a
variety of
conditions](a2f551eb2d/components/servo/webview.rs (L596-L602))
that may affect test output. it’s not clear if this is
[conformant](https://w3c.github.io/webdriver/#screen-capture), so we may
want to refine this to only wait when running tests at some point. other
changes:

- we remove the retry loop where we try to take a screenshot every
second for up to 30 seconds
- we send the result as a image::RgbaImage over crossbeam without shared
memory (it’s not cross-process)
- we now handle the zero-sized element case directly in the WebDriver
server

Testing: This should fix some flaky tests.
Fixes: #36715.
Fixes: (partially) #39180.
Fixes: (partially) #34683.

Signed-off-by: Delan Azabani <dazabani@igalia.com>
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
2025-10-01 12:37:00 +00:00
..
desktop webdriver: Use take_screenshot() API in Take (Element) Screenshot (#39587) 2025-10-01 12:37:00 +00:00
egl webdriver: Use take_screenshot() API in Take (Element) Screenshot (#39587) 2025-10-01 12:37:00 +00:00
platform servoshell: Hide information about outstanding threads by default. (#39044) 2025-08-30 20:40:29 +00:00
backtrace.rs Add OpenHarmony support to servoshell (#32594) 2024-06-28 12:51:50 +00:00
build.rs servoshell: Switch from winres to winresources (#39344) 2025-09-17 08:04:45 +00:00
Cargo.toml build(deps): bump the napi-ohos-related group with 5 updates (#39595) 2025-10-01 00:59:09 +00:00
crash_handler.rs Fix various clippy warnings on OpenHarmony (#34281) 2024-11-19 05:21:48 +00:00
lib.rs libservo: Add a WebView::take_screenshot() API and use it for reftests (#39583) 2025-09-30 11:39:47 +00:00
main.rs Make tracing available on all platforms, with or without perfetto (#33301) 2024-09-04 12:56:29 +00:00
panic_hook.rs api: Flatten and simplify Servo preferences (#34966) 2025-01-14 13:54:06 +00:00
parser.rs cargo: Bump rustc to 1.89 (#36818) 2025-08-19 11:07:53 +00:00
prefs.rs servoshell: Do not override HiDPI ratio when taking screenshots (#39501) 2025-09-30 17:44:14 +00:00
resources.rs libservo: Stop using script_traits in the embedding layer (#35185) 2025-01-28 11:15:36 +00:00
test.rs Allow domain-like as URL location input (#35756) 2025-03-10 03:24:48 +00:00