wpt
wpt copied to clipboard
Window resize fails in Chrome Android
Right now, reftests aren't working for Chrome android because there's no concept of resizing the window.
We should at least either either ignore or work around this issue, possibly by hacking in a zoom modification in lieu of the ability to resize the window itself? @Hexcles
While the required window size isn't met by android, we'd still get some value from being able to produce the screenshots.
Possibly related to https://github.com/web-platform-tests/wpt/issues/8571, though we don't have infra coverage for Android anyway.
There's no way to resize a window on Android, but we most likely need to reset the zoom level to 100% to make sure the screenshots are meaningful, comparable and stable. However, it seems like WebDriver specs has no mentioning of zoom level.
I'm looking at document.body.style.zoom, which is unfortunately a Blink/WebKit-only API but perhaps can be justified to use here.
Also related to #7598 #12725
Zoom could and should be easily added to WebDriver.
Note that running reftests on mobile has some interesting challenges. For example you need to ensure that the device pixel ratio is set to 1, even though phones usually have a very different value. Getting the viewport to be the expected size is also a problem. Gecko basically has some special settings that afiak are only used for reftests that allow creating a document with the correct size and getting a screenshot of the full document independent of the actual device size.
@lukebjerring set to backlog priority, but maybe should be higher if it's blocking Android runs?
We can easily bypass reftests on Android for now. The question is how much value we can get out of reftests on Android.
As far as I can tell, there's not a Chromium bug to track supporting custom viewport sizes on Android.
@jonathan-j-lee pointed me at https://issues.chromium.org/issues/40193012 which changed WebDriver Set Window Rect to always succeed with a no-op.
This is probably a violation of the WebDriver spec, which says:
If the remote end does not support the Set Window Rect command for session's current top-level browsing context for any reason, return error with error code unsupported operation.
Note: In case the Set Window Rect command is partially supported (i.e. some combinations of arguments are supported but not others), the implmentation is expected to continue with the remaining steps.
wptrunner should probably allow for Set Window Rect failing to resize (either via unsupported operation or just being a no-op), so we get some coverage of reftests on platforms which don't support it, but we should probably get a warning in the logs.