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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/feature-policy/fullscreen-allowed-by-container-policy-relocate.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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../../resources/testharness.js"></script>
3 <script src="../../resources/testharnessreport.js"></script>
4 <script>
5 if (window.testRunner) {
6 testRunner.dumpAsText();
7 testRunner.dumpAsText();
8 }
9 </script>
10 <iframe id="f1" src="about:blank" allow="fullscreen"></iframe>
11 <iframe id="f2" src="about:blank" allow="fullscreen" allowfullscreen></iframe>
12 <iframe id="f3" src="about:blank" allowfullscreen></iframe>
13 <iframe id="f4" src="about:blank" allow="fullscreen"></iframe>
14 <iframe id="f5" src="about:blank" allow="fullscreen" allowfullscreen></iframe>
15 <iframe id="f6" src="about:blank" allowfullscreen></iframe>
16 <script>
17 function loadFrame(id, src, is_feature_enabled) {
18 var iframe = document.getElementById(id);
19 promise_test(function(t) {
20 iframe.src = src;
21 return new Promise(function(resolve, reject) {
22 window.addEventListener('message', function(e) {
23 if (e.data.type === 'change' || e.data.type === 'error') {
24 resolve(e.data);
25 }
26 });
27 }).then(function(data) {
28 if (is_feature_enabled) {
29 assert_true(data.enabled, 'Document.fullscreenEnabled:');
30 assert_equals(data.type, 'change', 'Document.requestFullscreen():');
31 } else {
32 assert_false(data.enabled, 'Document.fullscreenEnabled:');
33 assert_equals(data.type, 'error', 'Document.requestFullscreen():');
34 }
35 });
36 }, 'iframe ' + id + ' relocated to URL: ' + src + ' with allowfullscreen = ' + iframe.allowFullscreen + ' is ' + (is_feature_enabled ? 'enabled' : 'disabled') + ' by container policy.');
37 }
38 loadFrame("f1", "http://localhost:8000/feature-policy/resources/feature-policy-f ullscreen.html", true);
39 loadFrame("f2", "http://localhost:8000/feature-policy/resources/feature-policy-f ullscreen.html", true);
40 loadFrame("f3", "http://localhost:8000/feature-policy/resources/feature-policy-f ullscreen.html", true);
41 loadFrame("f4", "resources/feature-policy-fullscreen-relocate.html", false);
42 loadFrame("f5", "resources/feature-policy-fullscreen-relocate.html", false);
43 loadFrame("f6", "resources/feature-policy-fullscreen-relocate.html", true);
44 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698