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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/feature-policy/fullscreen-allowed-by-container-policy.html

Issue 2767983003: Initial Implementation of Iframe Attribute for Feature Policy (Part 4) (Closed)
Patch Set: Codereview: nit + added more unit tests for container policy Created 3 years, 8 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/http/tests/feature-policy/fullscreen-allowed-by-container-policy.html
diff --git a/third_party/WebKit/LayoutTests/http/tests/feature-policy/fullscreen-allowed-by-container-policy.html b/third_party/WebKit/LayoutTests/http/tests/feature-policy/fullscreen-allowed-by-container-policy.html
new file mode 100644
index 0000000000000000000000000000000000000000..406a03ce96de792f1d4a769d531c77537fe8d238
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/feature-policy/fullscreen-allowed-by-container-policy.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<iframe id="f1" allow="fullscreen"></iframe>
+<iframe id="f2" allow="fullscreen" allowfullscreen></iframe>
+<script>
+var srcs = [
+ "resources/feature-policy-fullscreen.html",
+ "http://localhost:8000/feature-policy/resources/feature-policy-fullscreen.html"
+];
+var f1 = document.getElementById('f1');
+var f2 = document.getElementById('f2');
+
+function loadFrames(iframe) {
+ for (var src of srcs) {
+ promise_test(function(t) {
+ iframe.src = src;
+ return new Promise(function(resolve, reject) {
+ window.addEventListener('message', function(e) {
+ resolve(e.data);
+ }, { once: true });
+ }).then(function(data) {
+ assert_true(data.enabled, 'Document.fullscreenEnabled:');
+ assert_equals(data.type, 'change', 'Document.requestFullscreen():');
+ });
+ }, 'Fullscreen is allowed on URL: ' + src + ' with allowfullscreen = ' + iframe.allowFullscreen);
+ }
+}
+
+loadFrames(f1);
+loadFrames(f2);
+</script>

Powered by Google App Engine
This is Rietveld 408576698