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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/dom/Element.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fullscreen/api/document-exit-fullscreen-vs-request.html
diff --git a/third_party/WebKit/LayoutTests/fullscreen/api/document-exit-fullscreen-vs-request.html b/third_party/WebKit/LayoutTests/fullscreen/api/document-exit-fullscreen-vs-request.html
new file mode 100644
index 0000000000000000000000000000000000000000..c1337e466a8a97fbc5ce8180701552f0ec1fcd1a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fullscreen/api/document-exit-fullscreen-vs-request.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<title>Document#exitFullscreen() vs. Element#requestFullscreen()</title>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script src="../trusted-event.js"></script>
+<div id="log"></div>
+<div id="target"></div>
+<script>
+// Adapted from https://github.com/w3c/web-platform-tests/pull/4250
+// TODO(foolip): Remove this test when the above is imported and passing.
+async_test(t => {
+ const target = document.getElementById("target");
+ trusted_request(target);
+
+ document.onfullscreenchange = t.step_func(() => {
+ document.onfullscreenchange = t.unreached_func("fullscreenchange event");
+ // We are now in fullscreen, so exiting requires a resize but requesting
+ // does not.
+ trusted_event(t.step_func(() => {
+ // Request fullscreen on the current fullscreen element, to ensure there
+ // is no short circuiting and that both requests fail. Note that the order
+ // of the two fullscreenerror events relative to the fullscreenchange
+ // event isn't tested, as it depends on whether the resize happens before
+ // the next animation frame or not.
+
+ let fullscreenchanges = 0;
+ document.onfullscreenchange = t.step_func((event) => {
+ fullscreenchanges++;
+ if (fullscreenchanges == 3) {
+ assert_equals(document.fullscreenElement, null);
+ t.done();
+ }
+ });
+ document.onfullscreenerror = t.unreached_func("fullscreenerror event");
+
+ assert_equals(document.fullscreenElement, target);
+ target.requestFullscreen();
+ document.exitFullscreen();
+ target.requestFullscreen();
+ }), target);
+ });
+});
+</script>
« 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