| Index: third_party/WebKit/LayoutTests/http/tests/feature-policy/fullscreen-allowed-by-container-policy-relocate.html
|
| diff --git a/third_party/WebKit/LayoutTests/http/tests/feature-policy/fullscreen-allowed-by-container-policy-relocate.html b/third_party/WebKit/LayoutTests/http/tests/feature-policy/fullscreen-allowed-by-container-policy-relocate.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..0fb8d85dba713e5c80a75a4fd205e859cef5ac67
|
| --- /dev/null
|
| +++ b/third_party/WebKit/LayoutTests/http/tests/feature-policy/fullscreen-allowed-by-container-policy-relocate.html
|
| @@ -0,0 +1,44 @@
|
| +<!DOCTYPE html>
|
| +<script src="../../resources/testharness.js"></script>
|
| +<script src="../../resources/testharnessreport.js"></script>
|
| +<script>
|
| + if (window.testRunner) {
|
| + testRunner.dumpAsText();
|
| + testRunner.dumpAsText();
|
| + }
|
| +</script>
|
| +<iframe id="f1" src="about:blank" allow="fullscreen"></iframe>
|
| +<iframe id="f2" src="about:blank" allow="fullscreen" allowfullscreen></iframe>
|
| +<iframe id="f3" src="about:blank" allowfullscreen></iframe>
|
| +<iframe id="f4" src="about:blank" allow="fullscreen"></iframe>
|
| +<iframe id="f5" src="about:blank" allow="fullscreen" allowfullscreen></iframe>
|
| +<iframe id="f6" src="about:blank" allowfullscreen></iframe>
|
| +<script>
|
| +function loadFrame(id, src, is_feature_enabled) {
|
| + var iframe = document.getElementById(id);
|
| + promise_test(function(t) {
|
| + iframe.src = src;
|
| + return new Promise(function(resolve, reject) {
|
| + window.addEventListener('message', function(e) {
|
| + if (e.data.type === 'change' || e.data.type === 'error') {
|
| + resolve(e.data);
|
| + }
|
| + });
|
| + }).then(function(data) {
|
| + if (is_feature_enabled) {
|
| + assert_true(data.enabled, 'Document.fullscreenEnabled:');
|
| + assert_equals(data.type, 'change', 'Document.requestFullscreen():');
|
| + } else {
|
| + assert_false(data.enabled, 'Document.fullscreenEnabled:');
|
| + assert_equals(data.type, 'error', 'Document.requestFullscreen():');
|
| + }
|
| + });
|
| + }, 'iframe ' + id + ' relocated to URL: ' + src + ' with allowfullscreen = ' + iframe.allowFullscreen + ' is ' + (is_feature_enabled ? 'enabled' : 'disabled') + ' by container policy.');
|
| +}
|
| +loadFrame("f1", "http://localhost:8000/feature-policy/resources/feature-policy-fullscreen.html", true);
|
| +loadFrame("f2", "http://localhost:8000/feature-policy/resources/feature-policy-fullscreen.html", true);
|
| +loadFrame("f3", "http://localhost:8000/feature-policy/resources/feature-policy-fullscreen.html", true);
|
| +loadFrame("f4", "resources/feature-policy-fullscreen-relocate.html", false);
|
| +loadFrame("f5", "resources/feature-policy-fullscreen-relocate.html", false);
|
| +loadFrame("f6", "resources/feature-policy-fullscreen-relocate.html", true);
|
| +</script>
|
|
|