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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/feature-policy-experimental-features/vibrate-allowed-by-container-policy.html

Issue 2855133004: Re-enable feature policy layout tests after bug fix. (Closed)
Patch Set: Updated fp-vibrate tests expect Created 3 years, 7 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
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../resources/testharness.js"></script> 2 <script src="../../resources/testharness.js"></script>
5 <script src="../../resources/testharnessreport.js"></script> 3 <script src="../../resources/testharnessreport.js"></script>
4 <script src="resources/helper.js"></script>
5 <iframe allow="vibrate"></iframe>
6 <script> 6 <script>
7 if (window.testRunner) { 7 var srcs = [
8 testRunner.dumpAsText(); 8 "resources/feature-policy-vibrate.html",
9 testRunner.dumpChildFramesAsText(); 9 "http://localhost:8000/feature-policy-experimental-features/resources/feature- policy-vibrate.html"];
10 }
11 10
12 function loaded() { 11 window.onload = function () {
13 var iframes = document.getElementsByTagName('iframe'); 12 var iframe = document.querySelector('iframe');
14 for (var i = 0; i < iframes.length; ++i) { // < 1; ++i) { // 13 iframe.addEventListener('load', sendClick);
15 var iframe = iframes[i]; 14 function loadFrame(src) {
16 // The iframe uses eventSender to emulate a user navigatation, which require s absolute coordinates. 15 promise_test(function() {
17 iframe.contentWindow.postMessage({x: iframe.offsetLeft, y: iframe.offsetTop} , "*"); 16 iframe.src = src;
17 return new Promise(function(resolve, reject) {
18 window.addEventListener('message', function(e) {
19 if (e.data.type === 'result') {
20 resolve(e.data);
21 }
22 });
23 }).then(function(data) {
24 assert_true(data.enabled, 'navigator.vibrate():');
25 });
26 }, 'Navigator.vibrate enabled by container policy on URL: ' + src);
27 }
28 for (var src of srcs) {
29 loadFrame(src);
18 } 30 }
19 } 31 }
20 </script> 32 </script>
21 </head>
22 <body onload="loaded();">
23 <iframe id="f1" src="resources/feature-policy-vibrate-enabled.html" allow="vibra te"></iframe>
24 <iframe id="f2" src="http://localhost:8000/feature-policy/feature-policy-vibrate -enabled.html" allow="vibrate"></iframe>
25 </body>
26 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698