OLD | NEW |
| (Empty) |
1 <!DOCTYPE html> | |
2 <html> | |
3 <head> | |
4 <script src="../../resources/testharness.js"></script> | |
5 <script src="../../resources/testharnessreport.js"></script> | |
6 <script> | |
7 if (window.testRunner) { | |
8 testRunner.dumpAsText(); | |
9 testRunner.dumpChildFramesAsText(); | |
10 } | |
11 | |
12 function loaded() { | |
13 var iframe = document.getElementById("f1"); | |
14 // Relocate iframe f1. Changing iframe.src will reload the document and update | |
15 // the policy. | |
16 iframe.src = "http://localhost:8000/feature-policy-experimental-features/resou
rces/feature-policy-vibrate-enabled.html"; | |
17 iframe.addEventListener("load", function() { | |
18 // The iframe uses eventSender to emulate a user navigatation, which | |
19 // requires absolute coordinates. | |
20 iframe.contentWindow.postMessage({x: iframe.offsetLeft, y: iframe.offsetTop}
, "*"); | |
21 }); | |
22 } | |
23 | |
24 // After updating document.location in iframe f2 (note that this does not cause | |
25 // document to reload therefore does not update the policy), use eventSender to | |
26 // triger navigator.vibrate. | |
27 function testVibrate() { | |
28 this.contentWindow.postMessage({x: iframe.offsetLeft, y: iframe.offsetTop}, "*
"); | |
29 } | |
30 | |
31 </script> | |
32 </head> | |
33 <body onload="loaded()"> | |
34 <iframe id="f1" src="about:blank" allow="vibrate"></iframe> | |
35 <iframe id="f2" src="resources/feature-policy-vibrate-relocate.html" onMessage="
testVibrate(this)" allow="vibrate"></iframe> | |
36 </body> | |
37 </html> | |
OLD | NEW |