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 same-origin iframe with user gesture is allowed.</titl
e> |
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. | |
18 frames[0].postMessage({x: iframe.offsetLeft, y: iframe.offsetTop}, "
*"); | 17 frames[0].postMessage({x: iframe.offsetLeft, y: iframe.offsetTop}, "
*"); |
19 } | 18 } |
20 </script> | 19 </script> |
21 </head> | 20 </head> |
22 <body onload="loaded();"> | 21 <body onload="loaded();"> |
23 <p>This tests that a cross-origin iframe with user gesture can vibrate.</p> | 22 <p>This tests that a same-origin iframe with user gesture can vibrate.</p> |
24 <h4>DOMAIN</h4> | 23 <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> | 24 <iframe id="i" src="resources/vibrate-in-same-origin-iframe-with-user-gestur
e-allowed.html"></iframe> |
26 </body> | 25 </body> |
27 </html> | 26 </html> |
OLD | NEW |