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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/security/vibration/vibrate-on-top-page-before-during-after-user-gesture.html

Issue 2834493002: Remove vibrate w/o user gesture by default (Closed)
Patch Set: Change to turn on by default 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 <title>Testing vibrate 3 times on the top page</title> 3 <title>Testing vibrate 3 times on the top page</title>
4 <script src="/resources/testharness.js"></script> 4 <script src="/resources/testharness.js"></script>
5 <script src="/resources/testharnessreport.js"></script> 5 <script src="/resources/testharnessreport.js"></script>
6 <script src="/js-test-resources/user-gesture-utils.js"></script> 6 <script src="/js-test-resources/user-gesture-utils.js"></script>
7 <script> 7 <script>
8 function startTest() 8 function startTest()
9 { 9 {
10 test(function() { 10 test(function() {
11 assert_true( 11 assert_false(
12 navigator.vibrate(200), 12 navigator.vibrate(200),
13 "1. Vibrate w/o user gesture is deprecated and will be blocked in M60."); 13 "1. Vibrate w/o user gesture is blocked.");
14 }); 14 });
15 15
16 // A manual click should enable vibrate. 16 // A manual click should enable vibrate.
17 var element = document.getElementById("test"); 17 var element = document.getElementById("test");
18 simulateUserClick(element.offsetLeft + 2, element.offsetTop + 2); 18 simulateUserClick(element.offsetLeft + 2, element.offsetTop + 2);
19 performTestWithClick(); 19 performTestWithClick();
20 } 20 }
21 21
22 function performTestWithClick() 22 function performTestWithClick()
23 { 23 {
(...skipping 12 matching lines...) Expand all
36 navigator.vibrate(200), 36 navigator.vibrate(200),
37 "3. Vibrate after user gesture succeeded."); 37 "3. Vibrate after user gesture succeeded.");
38 }); 38 });
39 } 39 }
40 </script> 40 </script>
41 </head> 41 </head>
42 <body onload="startTest();"> 42 <body onload="startTest();">
43 <button id="test">Click to vibrate</button> 43 <button id="test">Click to vibrate</button>
44 </body> 44 </body>
45 </html> 45 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698