OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script src="../resources/js-test.js"></script> | 3 <script src="../resources/js-test.js"></script> |
| 4 <script src="../resources/user-gesture-utils.js"></script> |
4 <script src="vibration-utils.js"></script> | 5 <script src="vibration-utils.js"></script> |
5 </head> | 6 </head> |
6 <body> | 7 <body> |
| 8 <h4 id="test"></h4> |
7 <script> | 9 <script> |
8 description('Tests that bad input throws exceptions in the Vibration API.'); | 10 description('Tests that bad input throws exceptions in the Vibration API.'); |
9 | 11 |
| 12 // Simulates a user click for vibrate to be allowed. |
| 13 // See: https://www.chromestatus.com/feature/5644273861001216. |
| 14 var element = document.getElementById("test"); |
| 15 simulateUserClick(element.offsetLeft + 2, element.offsetTop + 2); |
| 16 |
10 shouldThrow("navigator.vibrate()"); | 17 shouldThrow("navigator.vibrate()"); |
11 shouldBe("navigator.vibrate(1, 2)", "true"); | 18 shouldBe("navigator.vibrate(1, 2)", "true"); |
12 shouldBe("navigator.vibrate([1], [2])", "true"); | 19 shouldBe("navigator.vibrate([1], [2])", "true"); |
13 | 20 |
14 </script> | 21 </script> |
15 </body> | 22 </body> |
16 </html> | 23 </html> |
OLD | NEW |