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

Side by Side Diff: third_party/WebKit/LayoutTests/fullscreen/api/document-exit-fullscreen-vs-request.html

Issue 2530883002: Refactor overlay fullscreen video handling into a single callback (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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/Element.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <title>Document#exitFullscreen() vs. Element#requestFullscreen()</title>
3 <script src="../../resources/testharness.js"></script>
4 <script src="../../resources/testharnessreport.js"></script>
5 <script src="../trusted-event.js"></script>
6 <div id="log"></div>
7 <div id="target"></div>
8 <script>
9 // Adapted from https://github.com/w3c/web-platform-tests/pull/4250
10 // TODO(foolip): Remove this test when the above is imported and passing.
11 async_test(t => {
12 const target = document.getElementById("target");
13 trusted_request(target);
14
15 document.onfullscreenchange = t.step_func(() => {
16 document.onfullscreenchange = t.unreached_func("fullscreenchange event");
17 // We are now in fullscreen, so exiting requires a resize but requesting
18 // does not.
19 trusted_event(t.step_func(() => {
20 // Request fullscreen on the current fullscreen element, to ensure there
21 // is no short circuiting and that both requests fail. Note that the order
22 // of the two fullscreenerror events relative to the fullscreenchange
23 // event isn't tested, as it depends on whether the resize happens before
24 // the next animation frame or not.
25
26 let fullscreenchanges = 0;
27 document.onfullscreenchange = t.step_func((event) => {
28 fullscreenchanges++;
29 if (fullscreenchanges == 3) {
30 assert_equals(document.fullscreenElement, null);
31 t.done();
32 }
33 });
34 document.onfullscreenerror = t.unreached_func("fullscreenerror event");
35
36 assert_equals(document.fullscreenElement, target);
37 target.requestFullscreen();
38 document.exitFullscreen();
39 target.requestFullscreen();
40 }), target);
41 });
42 });
43 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/Element.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698