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

Unified Diff: third_party/WebKit/LayoutTests/fullscreen/api/element-request-fullscreen-two-iframes.html

Issue 2550703002: Move pending state from FullscreenController to Fullscreen (Closed)
Patch Set: tests and documentation 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
Index: third_party/WebKit/LayoutTests/fullscreen/api/element-request-fullscreen-two-iframes.html
diff --git a/third_party/WebKit/LayoutTests/fullscreen/api/element-request-fullscreen-two-iframes.html b/third_party/WebKit/LayoutTests/fullscreen/api/element-request-fullscreen-two-iframes.html
new file mode 100644
index 0000000000000000000000000000000000000000..c9b0ed6a8eb4def88bb3ebf33614d6a4746226fe
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fullscreen/api/element-request-fullscreen-two-iframes.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<title>Element#requestFullscreen() on two elements in different iframes</title>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script src="../trusted-click.js"></script>
+<div id="log"></div>
+<iframe id="a" allowfullscreen></iframe>
+<iframe id="b" allowfullscreen></iframe>
+<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 => {
+ // Request fullscreen on the body elements of both iframes, but in reverse
+ // tree order.
+ const a = document.getElementById('a');
+ const b = document.getElementById('b');
+
+ // Expect first a fullscreenchange event for the second (!) request, then a
+ // fullscreenerror event for the first request. TODO(foolip): Remove the
+ // Fullscreen hierarchy restrictions. https://crbug.com/627792
+ a.contentDocument.onfullscreenerror = t.step_func(() => {
+ b.contentDocument.onfullscreenchange = t.step_func_done(() => {
+ assert_equals(document.fullscreenElement, b, 'fullscreenElement');
+ assert_equals(a.contentDocument.fullscreenElement, null, 'fullscreenElement in iframe a');
+ assert_equals(b.contentDocument.fullscreenElement, b.contentDocument.body, 'fullscreenElement in iframe b');
+ });
+ });
+ a.contentDocument.onfullscreenchange = t.unreached_func('fullscreenchange event in iframe a');
+ b.contentDocument.onfullscreenerror = t.unreached_func('fullscreenerror event in iframe b');
+
+ trusted_click(t.step_func(() => {
+ b.contentDocument.body.requestFullscreen();
+ a.contentDocument.body.requestFullscreen();
+ }), document.body);
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698