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.
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.
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