OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <script src="../../resources/testharness.js"></script> | |
3 <script src="../../resources/testharnessreport.js"></script> | |
4 <iframe src="about:blank" allow="vibrate"></iframe> | |
5 <script> | |
6 function sendClick() { | |
7 // The iframe uses eventSender to emulate a user navigatation, which requires | |
8 // absolute coordinates. | |
9 this.contentWindow.postMessage({x: this.offsetLeft, y: this.offsetTop}, "*"); | |
10 } | |
11 | |
12 window.onload = function () { | |
13 var iframe = document.querySelector('iframe'); | |
14 var src = "http://localhost:8000/feature-policy-experimental-features/resource s/feature-policy-vibrate.html"; | |
15 iframe.addEventListener('load', sendClick); | |
16 promise_test(function() { | |
17 iframe.src = src; | |
18 return new Promise(function(resolve, reject) { | |
19 window.addEventListener('message', function(e) { | |
20 if (e.data.type === 'result') { | |
21 resolve(e.data); | |
22 } | |
23 }); | |
24 }).then(function(data) { | |
25 assert_true(data.enabled, 'navigator.vibrate():'); | |
26 }); | |
27 }, 'iframe reloaded to URL: ' + src + ', allow = vibrate, is enabled on ' + | |
iclelland
2017/05/18 19:36:12
And here, maybe instead of "reloaded to URL", we c
lunalu1
2017/05/19 20:54:08
Done.
| |
28 'cross-origin by container policy.'); | |
29 } | |
30 </script> | |
OLD | NEW |