Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(331)

Side by Side Diff: third_party/WebKit/LayoutTests/imported/wpt/fullscreen/api/element-request-fullscreen-timing-manual.html

Issue 2610243002: Import wpt@5e1a3b80cea8d36774d2afd78b29a74792e9f15a (Closed)
Patch Set: Rebased Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <title>Element#requestFullscreen() timing</title> 2 <title>Element#requestFullscreen() timing</title>
3 <script src="/resources/testharness.js"></script> 3 <script src="/resources/testharness.js"></script>
4 <script src="/resources/testharnessreport.js"></script> 4 <script src="/resources/testharnessreport.js"></script>
5 <script src="../trusted-click.js"></script> 5 <script src="../trusted-click.js"></script>
6 <div id="log"></div> 6 <div id="log"></div>
7 <script> 7 <script>
8 async_test(t => { 8 async_test(t => {
9 trusted_request(document.querySelector('div')); 9 trusted_request(t, document.querySelector('div'));
10 10
11 // If fullscreenchange is an animation frame event, then animation frame 11 // If fullscreenchange is an animation frame event, then animation frame
12 // callbacks should be run after it is fired, before the timer callback. 12 // callbacks should be run after it is fired, before the timer callback.
13 // The resize event should fire before the fullscreenchange event. 13 // The resize event should fire before the fullscreenchange event.
14 const events = []; 14 const events = [];
15 const callback = t.step_func(event => { 15 const callback = t.step_func(event => {
16 events.push(event.type); 16 events.push(event.type);
17 if (event.type == 'fullscreenchange') { 17 if (event.type == 'fullscreenchange') {
18 setTimeout(t.unreached_func('timer callback')); 18 setTimeout(t.unreached_func('timer callback'));
19 requestAnimationFrame(t.step_func_done(() => { 19 requestAnimationFrame(t.step_func_done(() => {
20 assert_array_equals(events, ['resize', 'fullscreenchange'], 'event order '); 20 assert_array_equals(events, ['resize', 'fullscreenchange'], 'event order ');
21 })); 21 }));
22 } 22 }
23 }); 23 });
24 document.onfullscreenchange = window.onresize = callback; 24 document.onfullscreenchange = window.onresize = callback;
25 }, 'Timing of fullscreenchange and resize events'); 25 }, 'Timing of fullscreenchange and resize events');
26 26
27 async_test(t => { 27 async_test(t => {
28 document.createElement('a').requestFullscreen(); 28 document.createElement('a').requestFullscreen();
29 29
30 // If fullscreenerror is an animation frame event, then animation frame 30 // If fullscreenerror is an animation frame event, then animation frame
31 // callbacks should be run after it is fired, before the timer callback. 31 // callbacks should be run after it is fired, before the timer callback.
32 document.onfullscreenerror = t.step_func(() => { 32 document.onfullscreenerror = t.step_func(() => {
33 setTimeout(t.unreached_func('timer callback')); 33 setTimeout(t.unreached_func('timer callback'));
34 requestAnimationFrame(t.step_func_done()); 34 requestAnimationFrame(t.step_func_done());
35 }); 35 });
36 }, 'Timing of fullscreenerror event'); 36 }, 'Timing of fullscreenerror event');
37 </script> 37 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698