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

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

Issue 2654083006: Revert of Sync requestFullscreen() and exitFullscreen() algorithms with the spec (Closed)
Patch Set: add failing test expectations Created 3 years, 11 months 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-twice.html
diff --git a/third_party/WebKit/LayoutTests/fullscreen/api/element-request-fullscreen-twice.html b/third_party/WebKit/LayoutTests/fullscreen/api/element-request-fullscreen-twice.html
new file mode 100644
index 0000000000000000000000000000000000000000..80d1761e8fa235a303523f4111b3f1d20fbe06df
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fullscreen/api/element-request-fullscreen-twice.html
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<title>Element#requestFullscreen() twice</title>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script src="../trusted-click.js"></script>
+<div id="log"></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 div = document.querySelector("div");
+
+ document.onfullscreenchange = t.step_func(() => {
+ assert_equals(document.fullscreenElement, div);
+ // Done, but ensure that there's only one fullscreenchange event.
+ document.onfullscreenchange = t.unreached_func("second fullscreenchange event");
+ setTimeout(t.step_func_done(), 0);
+ });
+ document.onfullscreenerror = t.unreached_func("fullscreenerror event");
+
+ trusted_click(t.step_func(() => {
+ // Request fullscreen twice.
+ div.requestFullscreen();
+ assert_equals(document.fullscreenElement, div, "fullscreenElement after first requestFullscreen()");
+ div.requestFullscreen();
+ assert_equals(document.fullscreenElement, div, "fullscreenElement after second requestFullscreen()");
+ }), document.body);
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698