blob: 9cdf282ebca7c828493ca84de9b2490018c7276e [file] [log] [blame]
Zhiqiang Zhang2c41d412014-09-02 07:50:291<!DOCTYPE html>
2<meta charset='utf-8'>
3<title>Vibration API: cancel ongoing vibrate() with [0]</title>
4<link rel='author' title='Intel' href='http://www.intel.com'>
5<link rel='help' href='http://dev.w3.org/2009/dap/vibration/#vibration-interface'>
6<meta name='flags' content='interact'>
7<meta name='assert' content='If pattern contains a single entry with a value of 0, cancel the pre-existing instance of the processing vibration patterns algorithm'>
8<style>
9 button {
10 height: 100px;
11 width: 100px;
12 }
13</style>
14
15<h1>Description</h1>
16<p>
17 After hitting the button below, your device must vibrate for a short period of time (roughly one
18 second). If it vibrates for a longer time (roughly five seconds, it should feel somewhat long) then
19 the test has failed.
20</p>
21<button id='vib'>Vibrate!</button>
Zhiqiang Zhang2c41d412014-09-02 07:50:2922<script>
23 if (undefined !== navigator.vibrate) {
24 document.getElementById('vib').onclick = function () {
25 navigator.vibrate(5000);
26 setTimeout(function () {
27 navigator.vibrate([0]);
28 }, 1000);
29 };
30 }
31</script>