api-is-present.html (959B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset='utf-8'/> 5 <title>Vibration API: test that the vibrate() method is present (with or without vendor prefix)</title> 6 <link rel='author' title='Robin Berjon' href='mailto:robin@berjon.com'/> 7 <link rel='help' href='http://www.w3.org/TR/vibration/#methods'/> 8 <meta name='flags' content='dom'/> 9 <meta name='assert' content='Check that the vibrate() method is present.'/> 10 </head> 11 <body> 12 <h1>Description</h1> 13 <p> 14 This test checks for the presence of the <code>vibrate()</code> method, taking 15 vendor prefixes into account. 16 </p> 17 <div id='log'></div> 18 <script src='/resources/testharness.js'></script> 19 <script src='/resources/testharnessreport.js'></script> 20 <script> 21 test(function () { 22 assert_not_equals(undefined, navigator.vibrate, "navigator.vibrate exists"); 23 }, "vibrate() is present on navigator"); 24 </script> 25 </body> 26 </html>