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

Unified Diff: third_party/WebKit/LayoutTests/imported/wpt/fullscreen/api/document-exit-fullscreen-timing-manual.html

Issue 2564543002: Add tests for fullscreenchange and fullscreenerror event timing (Closed)
Patch Set: 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/imported/wpt/fullscreen/api/document-exit-fullscreen-timing-manual.html
diff --git a/third_party/WebKit/LayoutTests/imported/wpt/fullscreen/api/document-exit-fullscreen-timing-manual.html b/third_party/WebKit/LayoutTests/imported/wpt/fullscreen/api/document-exit-fullscreen-timing-manual.html
new file mode 100644
index 0000000000000000000000000000000000000000..4e0013c6cfb8d71366153532564cb5dd2e46e929
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/imported/wpt/fullscreen/api/document-exit-fullscreen-timing-manual.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<title>Document#exitFullscreen() timing</title>
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="../trusted-click.js"></script>
+<div id="log"></div>
+<script>
+async_test(t => {
+ const div = document.querySelector('div');
+ trusted_request(div);
+
+ document.onfullscreenchange = t.step_func(() => {
+ // We are now in fullscreen. Exit again.
+ assert_equals(document.fullscreenElement, div);
+ document.exitFullscreen();
+
+ // If fullscreenchange is an animation frame event, then animation frame
+ // callbacks should be run after it is fired, before the timer callback.
+ // The resize event, if any, should fire before the fullscreenchange event.
+ let resized = false;
+ document.onfullscreenchange = t.step_func(() => {
+ if (!resized)
+ console.info('resize event timing not tested');
mlamouri (slow - plz ping) 2016/12/08 14:23:24 Should that fail?
foolip 2016/12/08 14:33:03 I did it this way because of https://crbug.com/672
mlamouri (slow - plz ping) 2016/12/08 15:12:10 You can also have an -expected.txt file if you hav
foolip 2016/12/08 15:16:57 Yes, but this failure is early, and so would mask
mlamouri (slow - plz ping) 2016/12/08 15:21:55 In case of it can help, testharness.js has an `Eve
foolip 2016/12/08 15:57:45 Yeah, I've been wanting to make use of that, but h
+ window.onresize = t.unreached_func('resize event');
+ setTimeout(t.unreached_func('timer callback'));
+ requestAnimationFrame(t.step_func_done());
+ });
+ window.onresize = t.step_func(() => resized = true);
+ });
+}, document.title + ' of fullscreenchange event');
+</script>

Powered by Google App Engine
This is Rietveld 408576698