wpt icon indicating copy to clipboard operation
wpt copied to clipboard

Support testdriver.js in reftests

Open gsnedders opened this issue 7 years ago • 22 comments

Previously, when testdriver.js we decided to punt on supporting it in reftests; we now have an actual use for it (#9346), so this needs done.

This will need changes in all the executors: the Python code needs to handle various messages to interact with the document before eventually taking a screenshot, and the JavaScript callbacks needs to deal with passing the testdriver.js messages. The right way to do this is probably by way of comparison of both bits of reftest code with the test harness code.

gsnedders avatar Sep 24 '18 10:09 gsnedders

Myself and @jgraham have separately on various occasions remembered that this is going to be somewhat awkward for Firefox the internal Marionette reftest runner, given we'll need to reimplement the testdriver.js implementation within Marionette for that.

Perhaps the right solution here is to just put some "testdriver" flag in the manifest and then use the external reftest runner for those tests.

gsnedders avatar Jan 14 '19 17:01 gsnedders

Yeah, that seems acceptable for a v1 implemenation; we would probably want to fix this to work inside the harness later, but that could be a seperate project.

jgraham avatar Jan 14 '19 17:01 jgraham

I'm concerned about the ongoing maintenance cost of having yet another implementation, especially one that wptrunner relies on (and which exists in an external repo). I'm not convinced the benefits of having the internal reftest runner support testdriver.js are actually big enough to outweigh that cost.

gsnedders avatar Jan 14 '19 17:01 gsnedders

It's probably a bad idea but we definitely could put the code in the wpt repo and ship it over to marionette in the reftest:setup.

jgraham avatar Jan 14 '19 18:01 jgraham

@gsnedders any chance of getting this fixed before the end of the quarter?

foolip avatar Mar 22 '19 10:03 foolip

Is there any reason to believe this is so high priority? Does it affect more tests than other untestable issues?

gsnedders avatar Apr 11 '19 15:04 gsnedders

@Hexcles having dug into test writing patterns in Chromium a bit, do you have a hunch for how often this would be useful? I'm inclined to agree with @gsnedders that maybe this isn't very high prio, but don't know.

foolip avatar Jun 05 '19 11:06 foolip

I've downgraded the priority. We'll probably want this to convert manual tests in the future, but at this point the request for it isn't coming from outside, it's just those of us working on wpt infra that think it's a good idea.

foolip avatar Oct 07 '19 08:10 foolip

My research only looked at existing tests / test history. And of course, there is zero testdriver usage in reftests as it doesn't work, but I don't know how many people attempted to do that.

Hexcles avatar Oct 08 '19 20:10 Hexcles

I think there was some discussion at TPAC suggesting this was needed for a whole bunch of tests, but I think it's pretty low priority still.

gsnedders avatar Oct 11 '19 00:10 gsnedders

So there is now at least one case of testdriver.js being used in reftests, in css/selectors/remove-hovered-element.html - which a Chromium engineer asked about today as it times out in all browsers in wpt.fyi.

Doing a quick grep, there are half a dozen cases today in the tree (some of which pass!):

$ grep -lr rel.*match  | xargs grep -lr testdriver.js 
css/css-grid/grid-model/grid-layout-stale-001.html
css/css-grid/grid-model/grid-layout-stale-002.html
css/css-shadow-parts/interaction-with-nested-pseudo-class.html
css/selectors/remove-hovered-element.html
pointerevents/pointerevent_releasepointercapture_invalid_pointerid.html
[tools/ entries]
docs/writing-tests/test-templates.md

stephenmcgruer avatar Dec 15 '20 19:12 stephenmcgruer

as it times out in all browsers in wpt.fyi.

Note that with the current testrunner implementation in Chromium's CI (which is not wptrunner), this test passes in Chromium's CI, which is why the engineer was surprised to discover the all-timeout status.

stephenmcgruer avatar Dec 15 '20 19:12 stephenmcgruer

I am adding some new tests which need this fixed here: https://github.com/web-platform-tests/wpt/pull/34169

josepharhar avatar May 31 '22 21:05 josepharhar

I forgot about this issue and wrote tests that don't work: https://github.com/web-platform-tests/wpt/pull/43445

foolip avatar Jan 11 '24 10:01 foolip

Using git grep -l /resources/testdriver.js | xargs grep -lE 'rel.*match' I found these 10 tests that are currently timing out because this doesn't work:

https://wpt.fyi/results/css/css-shadow-parts/interaction-with-nested-pseudo-class.html https://wpt.fyi/results/css/css-text-decor/invalidation/text-decoration-thickness.html https://wpt.fyi/results/css/css-view-transitions/hit-test-unpainted-element.html https://wpt.fyi/results/css/css-view-transitions/hit-test-unrelated-element.html https://wpt.fyi/results/css/selectors/remove-hovered-element.html https://wpt.fyi/results/fullscreen/rendering/backdrop-iframe.html https://wpt.fyi/results/fullscreen/rendering/backdrop-inherit.html https://wpt.fyi/results/fullscreen/rendering/backdrop-object.html https://wpt.fyi/results/fullscreen/rendering/fullscreen-root-fills-page.html https://wpt.fyi/results/html/semantics/forms/the-selectlist-element/selectlist-option-arbitrary-content-displayed.tentative.html

I also found these two that pass because there's no class="reftest-wait", so the tests probably don't have the intended coverage:

https://wpt.fyi/results/css/css-grid/grid-model/grid-layout-stale-001.html https://wpt.fyi/results/css/css-grid/grid-model/grid-layout-stale-002.html

I fixed two tests that were a bit confused in https://github.com/web-platform-tests/wpt/pull/43937 and https://github.com/web-platform-tests/wpt/pull/43938.

foolip avatar Jan 11 '24 10:01 foolip

We also have class="test-wait" for crash tests, and I've found one test like that which is also timing out:

https://wpt.fyi/results/accessibility/crashtests/svg-mouse-listener.html

foolip avatar Jan 12 '24 11:01 foolip

I'm working on a bunch of reftests which need testdriver for user activation here: https://github.com/web-platform-tests/wpt/tree/master/html/semantics/forms/the-select-element/stylable-select

josepharhar avatar May 13 '24 22:05 josepharhar

I realized we should put such tests in wpt_internal until this issue is fixed. @josepharhar WDYT?

WeizhongX avatar May 25 '24 01:05 WeizhongX

I realized we should put such tests in wpt_internal until this issue is fixed. @josepharhar WDYT?

That sounds fine to me

josepharhar avatar May 29 '24 15:05 josepharhar

I've downgraded the priority. We'll probably want this to convert manual tests in the future, but at this point the request for it isn't coming from outside, it's just those of us working on wpt infra that think it's a good idea.

I'd like to revisit the priority of this issue. While it perhaps didn't have many users before, there is one key new feature that requires this functionality: the customizable-<select> project, whose primary use case is improving stylability and interoperability of the picker for <select>. Since we can't open the picker without testdriver functionality (e.g. test_driver.bless()), we can't effectively test the appearance of the picker via WPT.

Are there any updates, or potential solutions/workarounds to get this to work? I'm happy to use a "hack" that lets me open pickers and use a regular reference test, if such a thing exists.

mfreed7 avatar Sep 05 '24 21:09 mfreed7

We can take a look at this in next quarter.

WeizhongX avatar Sep 05 '24 21:09 WeizhongX

FWIW the "hack" solution here would be to expose element screenshots via testdriver and then you could make a custom implementation of reftests in testharness tests.

jgraham avatar Sep 06 '24 15:09 jgraham

There are several other things that require this for testing:

  • spelling/grammar/etc markers (anything normally added by the user agent based on user action).
  • Editing caret rendering
  • The aforementioned things needing user activation

Regarding the solution of exposing screen shots in testdriver, that solution is analogous to canvas tests that extract the canvas contents to a bitmap and then check pixels. It works well if you want to know that something happened, or if you want to check a few specific pixels, but it's hard to check something like whether the correct content appears inside a popup.

schenney-chromium avatar Oct 30 '24 13:10 schenney-chromium

After #48486 is there anything else to be done for this issue?

past avatar Jan 07 '25 01:01 past

Not that this RFC issue should be open for, certainly; https://github.com/web-platform-tests/rfcs/pull/211 resolved what this was tracking.

gsnedders avatar Jan 07 '25 01:01 gsnedders