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

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

Issue 2564543002: Add tests for fullscreenchange and fullscreenerror event timing (Closed)
Patch Set: Created 4 years 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
(Empty)
1 <!DOCTYPE html>
2 <title>Document#exitFullscreen() timing</title>
3 <script src="/resources/testharness.js"></script>
4 <script src="/resources/testharnessreport.js"></script>
5 <script src="../trusted-click.js"></script>
6 <div id="log"></div>
7 <script>
8 async_test(t => {
9 const div = document.querySelector('div');
10 trusted_request(div);
11
12 document.onfullscreenchange = t.step_func(() => {
13 // We are now in fullscreen. Exit again.
14 assert_equals(document.fullscreenElement, div);
15 document.exitFullscreen();
16
17 // If fullscreenchange is an animation frame event, then animation frame
18 // callbacks should be run after it is fired, before the timer callback.
19 // The resize event, if any, should fire before the fullscreenchange event.
20 let resized = false;
21 document.onfullscreenchange = t.step_func(() => {
22 if (!resized)
23 console.info('resize event timing not tested');
mlamouri (slow - plz ping) 2016/12/08 14:23:24 Should that fail?
foolip 2016/12/08 14:33:03 I did it this way because of https://crbug.com/672
mlamouri (slow - plz ping) 2016/12/08 15:12:10 You can also have an -expected.txt file if you hav
foolip 2016/12/08 15:16:57 Yes, but this failure is early, and so would mask
mlamouri (slow - plz ping) 2016/12/08 15:21:55 In case of it can help, testharness.js has an `Eve
foolip 2016/12/08 15:57:45 Yeah, I've been wanting to make use of that, but h
24 window.onresize = t.unreached_func('resize event');
25 setTimeout(t.unreached_func('timer callback'));
26 requestAnimationFrame(t.step_func_done());
27 });
28 window.onresize = t.step_func(() => resized = true);
29 });
30 }, document.title + ' of fullscreenchange event');
31 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698