| <!DOCTYPE html> |
| <script src="../../resources/testharness.js"></script> |
| <script src="../../resources/testharnessreport.js"></script> |
| <script src="resources/helper.js"></script> |
| <iframe allow="fullscreen"></iframe> |
| <iframe allow="fullscreen" allowfullscreen></iframe> |
| <script> |
| var srcs = [ |
| "resources/feature-policy-fullscreen.html", |
| "http://localhost:8000/feature-policy/resources/feature-policy-fullscreen.html" |
| ]; |
| |
| function loadFrame(iframe, src) { |
| var allowFullscreen = iframe.allowFullscreen; |
| promise_test(function() { |
| 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 = ' + |
| allowFullscreen); |
| } |
| |
| window.onload = function() { |
| loadIframes(srcs); |
| } |
| </script> |