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

Unified Diff: third_party/WebKit/LayoutTests/external/wpt/fullscreen/api/resources/attempt-fullscreen.html

Issue 2898503002: Reenable feature policy control over fullscreen (Closed)
Patch Set: Reworking tests a bit Created 3 years, 4 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/external/wpt/fullscreen/api/resources/attempt-fullscreen.html
diff --git a/third_party/WebKit/LayoutTests/external/wpt/fullscreen/api/resources/attempt-fullscreen.html b/third_party/WebKit/LayoutTests/external/wpt/fullscreen/api/resources/attempt-fullscreen.html
new file mode 100644
index 0000000000000000000000000000000000000000..d1cb7b6bd5e63bd5cb166e5d7c69ef3efc05fcf8
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/wpt/fullscreen/api/resources/attempt-fullscreen.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>IFrame Fullscreen API success reporter</title>
+<body>
+<script>
+reportFullscreenSuccessful = (success) => {
+ return () => {
+ parent.postMessage({"report": {
+ "api": "fullscreen",
+ "result": success,
+ "frame": window.name
+ }}, "*");
+ };
+};
+
+exitFullscreenAndReportSuccess = () => {
+ document.onfullscreenchange = reportFullscreenSuccessful(true);
+ document.exitFullscreen();
foolip 2017/08/16 21:43:15 I suppose it was annoying to be left in fullscreen
iclelland 2017/08/17 20:01:56 Done.
+};
+
+window.addEventListener('message', e => {
+ if (e.data.action == "report") {
+ document.onfullscreenchange = exitFullscreenAndReportSuccess;
+ document.onfullscreenerror = reportFullscreenSuccessful(false);
+ document.body.requestFullscreen();
+ }
+});
+</script>

Powered by Google App Engine
This is Rietveld 408576698