-
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
Test the "fully active" check for requestFullscreen() #5901
Conversation
Firefox (nightly)Testing web-platform-tests at revision 93d2c64 All results1 test ran/fullscreen/api/element-request-fullscreen-active-document.html
|
Chrome (unstable)Testing web-platform-tests at revision 93d2c64 All results1 test ran/fullscreen/api/element-request-fullscreen-active-document.html
|
Promise.resolve().then(t.step_func(() => assert_true(rejected))); | ||
} | ||
// Wait two animation frames to ensure that no events are fired. (One should | ||
// be enough per spec, but this makes the test flaky in Firefox.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you are concerned about the fullscreen transition... probably you can wait for a second instead I guess.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't concerned with any transition because this is an error case, rather I want to wait just long enough to know that the fullscreenerror event is not fired. Per current spec that should be at the next animation frame, so one rAF should be enough.
I looked into Gecko's code and see that you use AsyncEventDispatcher
, which looks like the equivalent of "queue a task to fire an event". I've confirmed that a single setTimeout would make the test fail reliably in Firefox, and that setting the timeout just before the requestFullscreen call makes it pass reliably, so that checks out.
I'll tweak the test to use a mix of rAF and setTimeout to handle either implementation.
Test for whatwg/fullscreen#85