OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../../resources/testharness.js"></script> |
| 3 <script src="../../resources/testharnessreport.js"></script> |
| 4 <script src="resources/helper.js"></script> |
| 5 <iframe src="about:blank" allow="vibrate"></iframe> |
| 6 <script> |
| 7 window.onload = function () { |
| 8 var iframe = document.querySelector('iframe'); |
| 9 var src = "http://localhost:8000/feature-policy-experimental-features/resource
s/feature-policy-vibrate.html"; |
| 10 iframe.addEventListener('load', sendClick); |
| 11 promise_test(function() { |
| 12 iframe.src = src; |
| 13 return new Promise(function(resolve, reject) { |
| 14 window.addEventListener('message', function(e) { |
| 15 if (e.data.type === 'result') { |
| 16 resolve(e.data); |
| 17 } |
| 18 }); |
| 19 }).then(function(data) { |
| 20 assert_true(data.enabled, 'navigator.vibrate():'); |
| 21 }); |
| 22 }, 'Iframe src set to ' + src + ', is enabled by container policy.'); |
| 23 } |
| 24 </script> |
OLD | NEW |