OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../../resources/testharness.js"></script> |
| 3 <script src="../../resources/testharnessreport.js"></script> |
| 4 <iframe id="f1" allow="fullscreen"></iframe> |
| 5 <iframe id="f2" allow="fullscreen" allowfullscreen></iframe> |
| 6 <script> |
| 7 var srcs = [ |
| 8 "resources/feature-policy-fullscreen.html", |
| 9 "http://localhost:8000/feature-policy/resources/feature-policy-fullscreen.html
" |
| 10 ]; |
| 11 var f1 = document.getElementById('f1'); |
| 12 var f2 = document.getElementById('f2'); |
| 13 |
| 14 function loadFrames(iframe) { |
| 15 for (var src of srcs) { |
| 16 promise_test(function(t) { |
| 17 iframe.src = src; |
| 18 return new Promise(function(resolve, reject) { |
| 19 window.addEventListener('message', function(e) { |
| 20 resolve(e.data); |
| 21 }, { once: true }); |
| 22 }).then(function(data) { |
| 23 assert_true(data.enabled, 'Document.fullscreenEnabled:'); |
| 24 assert_equals(data.type, 'change', 'Document.requestFullscreen():'); |
| 25 }); |
| 26 }, 'Fullscreen is allowed on URL: ' + src + ' with allowfullscreen = ' + ifr
ame.allowFullscreen); |
| 27 } |
| 28 } |
| 29 |
| 30 loadFrames(f1); |
| 31 loadFrames(f2); |
| 32 </script> |
OLD | NEW |