New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider ways of advancing virtual time #17489
Comments
We now have 3 requests for this feature; for cc @jgraham as well |
It would probably make performance API testing a lot simpler as well. Some of those tests are super tricky flakiness-wise because of the time aspect. |
For an example of an existing mechanism that's similar to this, see these APIs on DOMWindowUtils that are used in a number of Gecko-internal mochitests. When I wrote them (for testing CSS animations, I think), I intended to hook them up to more sources of time than they're currently hooked up to (for example, in this bug), but never actually did so. (I wouldn't be surprised if hooking them up to more sources of time today might break some of the existing tests that use them.) |
This would be useful for testing privacy features that clear state based on a timer; e.g. bounce tracking mitigations. Without the ability to advance time we basically cannot write WPT tests for this kind of feature. |
In C++ tests we have the ability to advance a virtual clock to test time-dependent things. In Web Platform Tests, e.g. testing default timeout behaviors or similar, we do not.
It's conceivable this virtual-clock infrastructure could be exposed as a test-only API. It would presumably affect setTimeout, Date.now, and various other related things.
The specific case that brought this up is wanting to test the default timeout for
<std-toast>
without actually waiting 3 seconds.The text was updated successfully, but these errors were encountered: