servo/ports/servoshell/egl
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
..
android libservo: Re-export types that are used by servoshell (#39586) 2025-09-30 16:36:05 +00:00
ohos libservo: Re-export types that are used by servoshell (#39586) 2025-09-30 16:36:05 +00:00
android.rs servoshell: Replace getopts with bpaf for argument parsing (#37194) 2025-09-05 08:17:38 +00:00
app_state.rs webdriver: Use take_screenshot() API in Take (Element) Screenshot (#39587) 2025-10-01 12:37:00 +00:00
host_trait.rs libservo: Clean up interfaces for alert()/confirm()/prompt() (#35579) 2025-02-27 02:49:08 +00:00
log.rs build(deps): bump nix from 0.29.0 to 0.30.1 (#38650) 2025-08-13 09:51:40 +00:00
mod.rs Migrate Android and OHOS ports to the delegate API (#35315) 2025-02-06 14:21:29 +00:00
ohos.rs build(deps): bump the napi-ohos-related group with 4 updates (#38555) 2025-08-13 12:52:00 +00:00