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..9885466ebb5540246b80fcf39dbd461ab6cd5721 |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/external/wpt/fullscreen/api/resources/attempt-fullscreen.html |
@@ -0,0 +1,23 @@ |
+<!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 |
+ }}, "*"); |
+ }; |
+}; |
+ |
+window.addEventListener('message', e => { |
+ if (e.data.action == "report") { |
+ document.onfullscreenchange = reportFullscreenSuccessful(true); |
+ document.onfullscreenerror = reportFullscreenSuccessful(false); |
+ document.body.requestFullscreen(); |
+ } |
+}); |
+</script> |