Skip to content

Test the "fully active" check for requestFullscreen()#5901

Merged
foolip merged 2 commits into
masterfrom
fullscreen-request-active
May 15, 2017
Merged

Test the "fully active" check for requestFullscreen()#5901
foolip merged 2 commits into
masterfrom
fullscreen-request-active

Conversation

@foolip

@foolip foolip commented May 12, 2017

Copy link
Copy Markdown
Member

@ghost

ghost commented May 12, 2017

Copy link
Copy Markdown

View the complete job log.

Firefox (nightly)

Testing web-platform-tests at revision 93d2c64
Using browser at version BuildID 20170514100406; SourceStamp 73b3fc64525b6816842c737e104ef2ac5482d217
Starting 10 test iterations
All results were stable

All results

1 test ran
/fullscreen/api/element-request-fullscreen-active-document.html
Subtest Results Messages
OK
Element#requestFullscreen() when the document is not the active document FAIL assert_unreached: fullscreenerror event Reached unreachable code

@ghost

ghost commented May 12, 2017

Copy link
Copy Markdown

View the complete job log.

Chrome (unstable)

Testing web-platform-tests at revision 93d2c64
Using browser at version 60.0.3095.5 dev
Starting 10 test iterations
All results were stable

All results

1 test ran
/fullscreen/api/element-request-fullscreen-active-document.html
Subtest Results Messages
OK
Element#requestFullscreen() when the document is not the active document FAIL documentBeforeNav.documentElement.requestFullscreen is not a function

@foolip foolip requested a review from upsuper May 12, 2017 10:59
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.)

Copy link
Copy Markdown
Member

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.

Copy link
Copy Markdown
Member Author

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.

foolip added a commit to whatwg/fullscreen that referenced this pull request May 15, 2017
@foolip foolip merged commit dcb1462 into master May 15, 2017
@foolip foolip deleted the fullscreen-request-active branch May 15, 2017 09:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants