Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(132)

Side by Side Diff: third_party/WebKit/LayoutTests/vibration/vibration-exceptions.html

Issue 2778693004: Remove navigator.vibrate without user gesture. (Closed)
Patch Set: rebase Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698