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 src="/js-test-resources/user-gesture-utils.js"></script> |
| 7 <script> |
| 8 |
| 9 function startTest(event) { |
| 10 // Simulates a user click for vibrate to be allowed. |
| 11 // See: https://www.chromestatus.com/feature/5644273861001216. |
| 12 simulateUserClick('test', event); |
| 13 } |
| 14 |
| 15 function testVibrate() { |
| 16 test(function () { |
| 17 assert_true(navigator.vibrate(200)); |
| 18 }, "An iframe may call navigator.vibrate with user gesture."); |
| 19 } |
| 20 |
| 21 window.addEventListener("message", startTest, false); |
| 22 </script> |
| 23 </head> |
| 24 <body> |
| 25 <button id="test" onclick="testVibrate();">Click to vibrate</button> |
| 26 </body> |
| 27 </html> |
OLD | NEW |