| OLD | NEW |
| 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 Loading... |
| 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> |
| OLD | NEW |