| <!DOCTYPE html> |
| <html> |
| <head> |
| <title>Vibrate in same-origin iframe with user gesture is allowed.</title> |
| <script src="/resources/testharness.js"></script> |
| <script src="/resources/testharnessreport.js"></script> |
| <script> |
| if (window.testRunner) { |
| testRunner.dumpAsText(); |
| testRunner.dumpChildFrames(); |
| } |
| function loaded() |
| { |
| document.getElementsByTagName('h4')[0].innerHTML = document.domain; |
| var iframe = document.getElementById("i"); |
| // The iframe uses eventSender to emulate a user navigatation, which requires absolute coordinates. |
| frames[0].postMessage({x: iframe.offsetLeft, y: iframe.offsetTop}, "*"); |
| } |
| </script> |
| </head> |
| <body onload="loaded();"> |
| <p>This tests that a same-origin iframe with user gesture can vibrate.</p> |
| <h4>DOMAIN</h4> |
| <iframe id="i" src="resources/vibrate-in-iframe-with-user-gesture-allowed.html"></iframe> |
| <script> |
| fetch_tests_from_window(document.getElementById("i").contentWindow); |
| </script> |
| </body> |
| </html> |