-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[docs] Include recommendations of what to use instead of timeouts #20715
Comments
Also update the reviewer checklist, which currently includes
https://web-platform-tests.org/reviewing-tests/checklist.html#script-tests-only |
Thanks for filing this! |
So, what is the recommended way to make a reftest with a delay, without using Context: I'm porting an animated PNG testsuite to WPT. Most tests just need a 3 to 7 second delay, and the reference includes a static PNG (such as the last frame of the animation, in simple cases). So it doesn't matter exactly when the comparison happens, just that it is after the duration of the animation. Currently I have const el = document.querySelector(".reftest-wait");
setTimeout(() => {
el.classList.remove('reftest-wait');
}, "3000"); Please tell me what I should be doing instead. I'm happy to make a documentation PR to improve this for others, too. |
Amusingly the one existing APNG test in WPT uses |
Ah, I see the advice is just to lne whitelist it, for reftests: |
@svgeesus yep. |
https://web-platform-tests.org/writing-tests/testharness-api.html#timeouts-in-tests should say what to use instead of timeouts
requestAnimationFrame
for things that need a spin of update the rendering steps.See #20712
The text was updated successfully, but these errors were encountered: