https://github.com/web-platform-tests/wpt
Revision 8214a83ae15810425ebbdb305ba5a0a746f4b36e authored by Stephen McGruer on 27 March 2018, 18:33:18 UTC, committed by Blink WPT Bot on 27 March 2018, 18:53:44 UTC
Bug: 699244
Change-Id: Ia85a44be9d9f7b0d0db382892520f2755523f514
Reviewed-on: https://chromium-review.googlesource.com/980236
Reviewed-by: Robert Flack <flackr@chromium.org>
Commit-Queue: Stephen McGruer <smcgruer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#546172}
1 parent e96e038
Raw File
Tip revision: 8214a83ae15810425ebbdb305ba5a0a746f4b36e authored by Stephen McGruer on 27 March 2018, 18:33:18 UTC
Port nested sticky tests from reftests to JS tests
Tip revision: 8214a83
cancel-with-0-manual.html
<!DOCTYPE html>
<html>
  <head>
    <meta charset='utf-8'/>
    <title>Vibration API: cancel ongoing vibrate() with 0</title>
    <link rel='author' title='Robin Berjon' href='mailto:robin@berjon.com'/>
    <link rel='help' href='http://www.w3.org/TR/vibration/#methods'/>
    <meta name='flags' content='dom, interact'/>
    <meta name='assert' content='If pattern is 0, cancel the pre-existing instance of the processing vibration patterns algorithm'/>
  </head>
  <body>
    <h1>Description</h1>
    <p>
      After hitting the button below, your device must vibrate for a short period of time (roughly one
      second). If it vibrates for a longer time (roughly five seconds, it should feel somewhat long) then
      the test has failed.
    </p>
    <button id='vib'>Vibrate!</button>
    <script>
      if (undefined !== navigator.vibrate) {
          document.getElementById("vib").onclick = function () {
              navigator.vibrate(5000);
              setTimeout(function () {
                  navigator.vibrate(0);
              }, 1000);
          };
      }
    </script>
  </body>
</html>
back to top