OLD | NEW |
---|---|
(Empty) | |
1 <!DOCTYPE html> | |
2 <script src="../../resources/testharness.js"></script> | |
3 <script src="../../resources/testharnessreport.js"></script> | |
4 <iframe src="resources/feature-policy-vibrate-relocate.html" allow="vibrate"></i frame> | |
5 <script> | |
6 window.onload = function () { | |
7 var iframe = document.querySelector('iframe'); | |
8 window.addEventListener('message', function() { | |
9 // The iframe uses eventSender to emulate a user navigatation, which | |
10 // requires absolute coordinates. | |
11 iframe.contentWindow.postMessage( | |
12 {x: iframe.offsetLeft, y: iframe.offsetTop}, "*"); | |
13 }, { once: true }); | |
14 promise_test(function() { | |
15 return new Promise(function(resolve, reject) { | |
16 window.addEventListener('message', function(e) { | |
17 if (e.data.type === 'result') { | |
18 resolve(e.data); | |
19 } | |
20 }); | |
21 }).then(function(data) { | |
22 assert_false(data.enabled, 'navigator.vibrate():'); | |
23 }); | |
24 }, 'iframe relocated without reload, allow = vibrate, is disabled on ' + | |
iclelland
2017/05/18 19:36:12
I think a clearer message here might be something
lunalu1
2017/05/19 20:54:08
Done
| |
25 'cross-origin by container policy.'); | |
26 } | |
27 </script> | |
OLD | NEW |