Add new access object callback
[framework/web/webkit-efl.git] / LayoutTests / vibration / cancelVibration-during-pattern-vibrating.html
1 <html>
2 <head>
3 <script src="../fast/js/resources/js-test-pre.js"></script>
4 </head>
5 <body>
6 <script>
7 description('Tests the cancelVibration during pattern vibration is working.');
8
9 var count = 0;
10 var cancelingTime = 80;
11
12 if (window.testRunner) {
13     function vibrate() {
14         navigator.vibrate([100, 100, 100, 100, 100]);
15         shouldBeTrue('internals.isVibrating()');
16         cancelVibration(cancelingTime + count * 100);
17     }
18
19     function cancelVibration(time) {
20         setTimeout(function() {
21             navigator.vibrate(0);
22             shouldBeFalse('internals.isVibrating()');
23             if (count++ == 2)
24                 finishJSTest();
25             vibrate();
26         }, time);
27     }
28
29     shouldBeFalse('internals.isVibrating()');
30     vibrate();
31     window.jsTestIsAsync = true;
32 } else
33     debug('This test can not be run without the TestRunner');
34 </script>
35 <script src="../fast/js/resources/js-test-post.js"></script>
36 </body>
37 </html>