OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <title>Vibrate in cross-origin iframe with user gesture is allowed.</tit
le> | 4 <title>Vibrate in cross-origin iframe with user gesture is allowed.</tit
le> |
5 <script src="/resources/testharness.js"></script> | 5 <script src="/resources/testharness.js"></script> |
6 <script src="/resources/testharnessreport.js"></script> | 6 <script src="/resources/testharnessreport.js"></script> |
7 <script> | 7 <script> |
8 if (window.testRunner) { | 8 if (window.testRunner) { |
9 testRunner.dumpAsText(); | 9 testRunner.dumpAsText(); |
10 testRunner.dumpChildFramesAsText(); | 10 testRunner.dumpChildFramesAsText(); |
11 } | 11 } |
12 function loaded() | 12 function loaded() |
13 { | 13 { |
14 document.getElementsByTagName('h4')[0].innerHTML = document.domain; | 14 document.getElementsByTagName('h4')[0].innerHTML = document.domain; |
15 var iframe = document.getElementById("i"); | 15 var iframe = document.getElementById("i"); |
16 // The iframe uses eventSender to emulate a user navigatation, which
requires absolute coordinates. | 16 // The iframe uses eventSender to emulate a user navigatation, which
requires absolute coordinates. |
17 // Because the iframe is cross-origin, it can't get the offsets itse
lf, so leak them. | 17 // Because the iframe is cross-origin, it can't get the offsets itse
lf, so leak them. |
18 frames[0].postMessage({x: iframe.offsetLeft, y: iframe.offsetTop}, "
*"); | 18 frames[0].postMessage({x: iframe.offsetLeft, y: iframe.offsetTop}, "
*"); |
19 } | 19 } |
20 </script> | 20 </script> |
21 </head> | 21 </head> |
22 <body onload="loaded();"> | 22 <body onload="loaded();"> |
23 <p>This tests that a cross-origin iframe with user gesture can vibrate.</p> | 23 <p>This tests that a cross-origin iframe with user gesture can vibrate.</p> |
24 <h4>DOMAIN</h4> | 24 <h4>DOMAIN</h4> |
25 <iframe id="i" src="http://localhost:8000/security/resources/cross-origin-if
rame-for-vibrate-with-user-gesture-allowed.html"></iframe> | 25 <iframe id="i" src="http://localhost:8000/security/vibration/resources/vibra
te-in-iframe-with-user-gesture-allowed.html"></iframe> |
26 </body> | 26 </body> |
27 </html> | 27 </html> |
OLD | NEW |