OLD | NEW |
1 <html> | 1 <html> |
2 <head> | 2 <head> |
3 <script src="../js/resources/js-test-pre.js"></script> | 3 <script src="../fast/js/resources/js-test-pre.js"></script> |
4 </head> | 4 </head> |
5 <body> | 5 <body> |
6 <script> | 6 <script> |
7 description('Test for the Vibration API.'); | 7 description('Test for the Vibration API.'); |
8 | 8 |
9 shouldBeTrue("navigator.vibrate(0);"); | 9 shouldBeTrue("navigator.vibrate(0);"); |
10 shouldBeTrue("navigator.vibrate([]);"); | 10 shouldBeTrue("navigator.vibrate([]);"); |
11 shouldBeTrue("navigator.vibrate(1);"); | 11 shouldBeTrue("navigator.vibrate(1);"); |
12 shouldBeTrue("navigator.vibrate([1, 2]);"); | 12 shouldBeTrue("navigator.vibrate([1, 2]);"); |
13 shouldBeTrue("navigator.vibrate([1, 2, 3]);"); | 13 shouldBeTrue("navigator.vibrate([1, 2, 3]);"); |
14 | 14 |
15 // Max pattern entry value. | 15 // Max pattern entry value. |
16 shouldBeTrue("navigator.vibrate(10000);"); | 16 shouldBeTrue("navigator.vibrate(10000);"); |
17 | 17 |
18 // Larger than max but the value is truncated and execution proceeds. | 18 // Larger than max but the value is truncated and execution proceeds. |
19 shouldBeTrue("navigator.vibrate(10001);"); | 19 shouldBeTrue("navigator.vibrate(10001);"); |
20 | 20 |
21 shouldBeTrue("navigator.vibrate(-1);"); | 21 shouldBeTrue("navigator.vibrate(-1);"); |
22 | 22 |
23 // Maximum pattern length. | 23 // Maximum pattern length. |
24 shouldBeTrue("var p = []; for (var i = 0; i < 99; i++) p[i] = 1; navigator.vibra
te(p);"); | 24 shouldBeTrue("var p = []; for (var i = 0; i < 99; i++) p[i] = 1; navigator.vibra
te(p);"); |
25 | 25 |
26 // Larger than max but the pattern is truncated and execution proceeds. | 26 // Larger than max but the pattern is truncated and execution proceeds. |
27 shouldBeTrue("var p = []; for (var i = 0; i < 100; i++) p[i] = 1; navigator.vibr
ate(p);"); | 27 shouldBeTrue("var p = []; for (var i = 0; i < 100; i++) p[i] = 1; navigator.vibr
ate(p);"); |
28 shouldThrow("navigator.vibrate();"); | 28 shouldThrow("navigator.vibrate();"); |
29 shouldThrow("navigator.vibrate([1], [2]);"); | 29 shouldThrow("navigator.vibrate([1], [2]);"); |
30 </script> | 30 </script> |
31 <script src="../js/resources/js-test-post.js"></script> | 31 <script src="../fast/js/resources/js-test-post.js"></script> |
32 </body> | 32 </body> |
33 </html> | 33 </html> |
OLD | NEW |