Closed jgraham closed 4 years ago
Is this something that can be implemented in a browser-agnostic way, or do we need browser-internal support? If the latter, would it be hard to implement in non-Gecko browsers?
I don't think there's anything magic here; just at the point at which we would take a screenshot we instead fire an event. So unless I'm missing something this is browser-agnostic.
The "instead" semantic isn't clear from the RFC details. That the event is only fired when the reftest-wait
class is present (and the test is a reftest?), seems good to point out.
Is there a need for an event like this for load tests?
I think it's sort of a moot point whether we also fire the event in the case where there isn't a reftest-wait
; although you could do something in response to the event before the screenshot was taken there would be no guarantee that the changes would be reflected in the rendering before the screenshot, so any test doing that would be buggy. But sure, in practice I think we won't fire this except when reftest-wait
is present to stop people doing the buggy thing. I'll update the PR.
Is there a need for an event like this for load tests?
Good question. It looks like there are some users of this in m-c: https://searchfox.org/mozilla-central/search?q=MozReftestInvalidate&path=crashtest
I updated the proposal to rename the event WptTestRendered
which seems like a better name if we're also going to use it for load tests. I also added the detailed steps and prepared a patch which implements this for webdriver and marionette (that uses an older iteration of the name without the Wpt
prefix).
Given the capitalization name conflicts with the web platform are virtually impossible, I'd like it better without the Wpt
prefix :)
Given the capitalization name conflicts with the web platform are virtually impossible, I'd like it better without the
Wpt
prefix :)
OK, changed.
I don't think this has substantive disagreement, so unless something comes up in the next day and a half I'm going to merge the issue and make a PR implementing the feature.
I think this is ready to go, I'll go ahead and merge.
No, actually, the file will and PR will need to be renamed, so I'll leave it you, @jgraham!
Can you add an example of how a test would use this? What is the event target, and does it bubble?