-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
79 additions
and
0 deletions.
There are no files selected for viewing
4 changes: 4 additions & 0 deletions
4
fullscreen/api/document-exit-fullscreen-timing-manual-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
This is a testharness.js-based test. | ||
FAIL Timing of fullscreenchange and resize events assert_array_equals: event order lengths differ, expected 2 got 1 | ||
Harness: the test ran to completion. | ||
|
33 changes: 33 additions & 0 deletions
33
fullscreen/api/document-exit-fullscreen-timing-manual.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<!DOCTYPE html> | ||
<title>Document#exitFullscreen() timing</title> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="../trusted-click.js"></script> | ||
<div id="log"></div> | ||
<script> | ||
async_test(t => { | ||
const div = document.querySelector('div'); | ||
trusted_request(div); | ||
|
||
document.onfullscreenchange = t.step_func(() => { | ||
// We are now in fullscreen. Exit again. | ||
assert_equals(document.fullscreenElement, div); | ||
document.exitFullscreen(); | ||
|
||
// If fullscreenchange is an animation frame event, then animation frame | ||
// callbacks should be run after it is fired, before the timer callback. | ||
// The resize event should fire before the fullscreenchange event. | ||
const events = []; | ||
const callback = t.step_func(event => { | ||
events.push(event.type); | ||
if (event.type == 'fullscreenchange') { | ||
setTimeout(t.unreached_func('timer callback')); | ||
requestAnimationFrame(t.step_func_done(() => { | ||
assert_array_equals(events, ['resize', 'fullscreenchange'], 'event order'); | ||
})); | ||
} | ||
}); | ||
document.onfullscreenchange = window.onresize = callback; | ||
}); | ||
}, 'Timing of fullscreenchange and resize events'); | ||
</script> |
5 changes: 5 additions & 0 deletions
5
fullscreen/api/element-request-fullscreen-timing-manual-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
This is a testharness.js-based test. | ||
FAIL Timing of fullscreenchange and resize events assert_unreached: timer callback Reached unreachable code | ||
PASS Timing of fullscreenerror event | ||
Harness: the test ran to completion. | ||
|
37 changes: 37 additions & 0 deletions
37
fullscreen/api/element-request-fullscreen-timing-manual.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<!DOCTYPE html> | ||
<title>Element#requestFullscreen() timing</title> | ||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="../trusted-click.js"></script> | ||
<div id="log"></div> | ||
<script> | ||
async_test(t => { | ||
trusted_request(document.querySelector('div')); | ||
|
||
// If fullscreenchange is an animation frame event, then animation frame | ||
// callbacks should be run after it is fired, before the timer callback. | ||
// The resize event should fire before the fullscreenchange event. | ||
const events = []; | ||
const callback = t.step_func(event => { | ||
events.push(event.type); | ||
if (event.type == 'fullscreenchange') { | ||
setTimeout(t.unreached_func('timer callback')); | ||
requestAnimationFrame(t.step_func_done(() => { | ||
assert_array_equals(events, ['resize', 'fullscreenchange'], 'event order'); | ||
})); | ||
} | ||
}); | ||
document.onfullscreenchange = window.onresize = callback; | ||
}, 'Timing of fullscreenchange and resize events'); | ||
|
||
async_test(t => { | ||
document.createElement('a').requestFullscreen(); | ||
|
||
// If fullscreenerror is an animation frame event, then animation frame | ||
// callbacks should be run after it is fired, before the timer callback. | ||
document.onfullscreenerror = t.step_func(() => { | ||
setTimeout(t.unreached_func('timer callback')); | ||
requestAnimationFrame(t.step_func_done()); | ||
}); | ||
}, 'Timing of fullscreenerror event'); | ||
</script> |