OLD | NEW |
---|---|
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <script src="../../resources/testharness.js"></script> | |
mustaq
2017/04/13 19:05:04
Add a <title>?
binlu
2017/04/18 15:48:29
Done.
| |
3 <script src="../../resources/testharnessreport.js"></script> | |
4 <script src="../../resources/user-gesture-utils.js"></script> | |
2 <script> | 5 <script> |
3 'use strict'; | 6 'use strict'; |
4 | 7 |
5 navigator.vibrate(1234); | 8 function startTest() { |
9 if (window.eventSender) { | |
10 var iframes = window.parent.document.getElementsByTagName('iframe'); | |
11 // The last iframe. | |
12 var iframe = iframes[iframes.length-1]; | |
13 var element = document.getElementById("test"); | |
14 simulateUserClick(element.offsetLeft + iframe.offsetLeft + 2, element.offset Top + iframe.offsetTop + 2); | |
15 } | |
16 } | |
6 | 17 |
18 function testVibrate() { | |
19 test(function () { | |
20 assert_true(navigator.vibrate(200)); | |
21 }, "An iframe may call navigator.vibrate with user gesture."); | |
22 } | |
7 </script> | 23 </script> |
24 <body onload="startTest();"> | |
25 <button id="test" onclick="testVibrate();">Click to vibrate</button> | |
26 </body> | |
27 </html> | |
28 | |
OLD | NEW |