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

Side by Side Diff: third_party/WebKit/LayoutTests/fullscreen/api/element-request-fullscreen-twice.html

Issue 2557943002: Sync requestFullscreen() and exitFullscreen() algorithms with the spec (Closed)
Patch Set: rebase 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
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <title>Element#requestFullscreen() twice</title> 2 <title>Element#requestFullscreen() twice</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 // Adapted from https://github.com/w3c/web-platform-tests/pull/4250 8 // Adapted from https://github.com/w3c/web-platform-tests/pull/4250
9 // TODO(foolip): Remove this test when the above is imported and passing. 9 // TODO(foolip): Remove this test when the above is imported and passing.
10 async_test(t => { 10 async_test(t => {
11 const div = document.querySelector("div"); 11 const div = document.querySelector("div");
12 12
13 document.onfullscreenchange = t.step_func(() => { 13 document.onfullscreenchange = t.step_func(() => {
14 assert_equals(document.fullscreenElement, div); 14 assert_equals(document.fullscreenElement, div);
15 // Done, but ensure that there's only one fullscreenchange event. 15 // Done, but ensure that there's only one fullscreenchange event.
16 document.onfullscreenchange = t.unreached_func("second fullscreenchange even t"); 16 document.onfullscreenchange = t.unreached_func("second fullscreenchange even t");
17 setTimeout(t.step_func_done(), 0); 17 setTimeout(t.step_func_done(), 0);
18 }); 18 });
19 document.onfullscreenerror = t.unreached_func("fullscreenerror event"); 19 document.onfullscreenerror = t.unreached_func("fullscreenerror event");
20 20
21 trusted_click(t.step_func(() => { 21 trusted_click(t.step_func(() => {
22 // Request fullscreen twice. 22 // Request fullscreen twice.
23 div.requestFullscreen(); 23 div.requestFullscreen();
24 assert_equals(document.fullscreenElement, div, "fullscreenElement after firs t requestFullscreen()"); 24 assert_equals(document.fullscreenElement, null, "fullscreenElement after fir st requestFullscreen()");
25 div.requestFullscreen(); 25 div.requestFullscreen();
26 assert_equals(document.fullscreenElement, div, "fullscreenElement after seco nd requestFullscreen()"); 26 assert_equals(document.fullscreenElement, null, "fullscreenElement after sec ond requestFullscreen()");
27 }), document.body); 27 }), document.body);
28 }); 28 });
29 </script> 29 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698