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 var element = document.getElementById("test"); |
| 14 simulateUserClick(element.offsetLeft + 2, element.offsetTop + 2); |
| 15 |
10 shouldThrow("navigator.vibrate()"); | 16 shouldThrow("navigator.vibrate()"); |
11 shouldBe("navigator.vibrate(1, 2)", "true"); | 17 shouldBe("navigator.vibrate(1, 2)", "true"); |
12 shouldBe("navigator.vibrate([1], [2])", "true"); | 18 shouldBe("navigator.vibrate([1], [2])", "true"); |
13 | 19 |
14 </script> | 20 </script> |
15 </body> | 21 </body> |
16 </html> | 22 </html> |
OLD | NEW |