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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/feature-policy/fullscreen-enabledforall.php

Issue 2585363002: Use FeaturePolicy to implement iframe[allowfullscreen] (Closed)
Patch Set: Avoid extra change event notification Created 3 years, 10 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/feature-policy/fullscreen-enabledforall-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <?php 1 <?php
2 // Copyright 2016 The Chromium Authors. All rights reserved. 2 // Copyright 2016 The Chromium Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be 3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file. 4 // found in the LICENSE file.
5 5
6 // This test ensures that fullscreen feature when enabled for all works across 6 // This test ensures that fullscreen feature when enabled for all works across
7 // origins when allowfullscreen is set. No iframe may call it when 7 // origins regardless of whether allowfullscreen is set. (Feature policy header
8 // allowfullscreen is not set. 8 // takes precedence over the absence of allowfullscreen.)
9 9
10 Header("Feature-Policy: {\"fullscreen\": [\"*\"]}"); 10 Header("Feature-Policy: {\"fullscreen\": [\"*\"]}");
11 ?> 11 ?>
12 12
13 <!DOCTYPE html> 13 <!DOCTYPE html>
14 <script src="../../resources/testharness.js"></script> 14 <script src="../../resources/testharness.js"></script>
15 <script src="../../resources/testharnessreport.js"></script> 15 <script src="../../resources/testharnessreport.js"></script>
16 <iframe id="f1"></iframe> 16 <iframe id="f1"></iframe>
17 <iframe id="f2" allowfullscreen></iframe> 17 <iframe id="f2" allowfullscreen></iframe>
18 <script> 18 <script>
19 var srcs = [ 19 var srcs = [
20 "resources/feature-policy-fullscreen.html", 20 "resources/feature-policy-fullscreen.html",
21 "http://localhost:8000/feature-policy/resources/feature-policy-fullscreen.html " 21 "http://localhost:8000/feature-policy/resources/feature-policy-fullscreen.html "
22 ]; 22 ];
23 var f1 = document.getElementById('f1'); 23 var f1 = document.getElementById('f1');
24 var f2 = document.getElementById('f2'); 24 var f2 = document.getElementById('f2');
25 25
26 function loadFrames(iframe) { 26 function loadFrames(iframe) {
27 for (var src of srcs) { 27 for (var src of srcs) {
28 promise_test(function(t) { 28 promise_test(function(t) {
29 iframe.src = src; 29 iframe.src = src;
30 return new Promise(function(resolve, reject) { 30 return new Promise(function(resolve, reject) {
31 window.addEventListener('message', function(e) { 31 window.addEventListener('message', function(e) {
32 resolve(e.data); 32 resolve(e.data);
33 }, { once: true }); 33 }, { once: true });
34 }).then(function(data) { 34 }).then(function(data) {
35 if (iframe.id === "f2") { 35 assert_true(data.enabled, 'Document.fullscreenEnabled:');
36 assert_true(data.enabled, 'Document.fullscreenEnabled:'); 36 assert_equals(data.type, 'change', 'Document.requestFullscreen():');
37 assert_equals(data.type, 'change', 'Document.requestFullscreen():');
38 } else {
39 assert_false(data.enabled, 'Document.fullscreenEnabled:');
40 assert_equals(data.type, 'error', 'Document.requestFullscreen():');
41 }
42 }); 37 });
43 }, 'Fullscreen enabled for all on URL: ' + src + ' with allowfullscreen = ' + iframe.allowFullscreen); 38 }, 'Fullscreen enabled for all on URL: ' + src + ' with allowfullscreen = ' + iframe.allowFullscreen);
44 } 39 }
45 } 40 }
46 41
47 loadFrames(f1); 42 loadFrames(f1);
48 loadFrames(f2); 43 loadFrames(f2);
49 </script> 44 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/http/tests/feature-policy/fullscreen-enabledforall-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698