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 |
index 406a03ce96de792f1d4a769d531c77537fe8d238..3fe0543e1c09679f6583484d66d7ff277412669a 100644 |
--- 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 |
@@ -1,32 +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 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" |
]; |
-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); |
- } |
+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); |
} |
-loadFrames(f1); |
-loadFrames(f2); |
+window.onload = function() { |
+ loadIframes(srcs); |
+} |
</script> |