mirror of
https://github.com/servo/servo.git
synced 2025-10-02 09:39:14 +01:00
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>
This commit is contained in:
parent
cd80d2724d
commit
cfa9e711c5
12 changed files with 106 additions and 151 deletions
|
@ -1,3 +0,0 @@
|
|||
[scroll_into_view.py]
|
||||
[test_scroll_into_view]
|
||||
expected: FAIL
|
Loading…
Add table
Add a link
Reference in a new issue