OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <body> | 2 <body> |
3 <script src="../../js/resources/js-test-pre.js"></script> | 3 <script src="../../js/resources/js-test-pre.js"></script> |
4 <input type="date" onclick="changeType(this)" /> | 4 <input type="date" onclick="changeType(this)" /> |
5 <script> | 5 <script> |
6 description('Check if we have no crash in a case that the input type is changed
by clicking the calendar picker indicator.'); | 6 description('Check if we have no crash in a case that the input type is changed
by clicking the calendar picker indicator.'); |
7 | 7 |
8 function changeType(input) { | 8 function changeType(input) { |
9 input.type = 'text'; | 9 input.type = 'text'; |
10 testPassed('unless crash or assertion failure'); | 10 testPassed('unless crash or assertion failure'); |
11 finishJSTest(); | 11 finishJSTest(); |
12 } | 12 } |
13 | 13 |
14 jsTestIsAsync = true; | 14 jsTestIsAsync = true; |
15 if (!window.eventSender) { | 15 if (!window.eventSender) { |
16 debug('Click on the triangle in the input field.'); | 16 debug('Click on the triangle in the input field.'); |
17 } else { | 17 } else { |
18 setTimeout(function() { | 18 setTimeout(function() { |
19 var dateInput = document.getElementsByTagName('input')[0]; | 19 var dateInput = document.getElementsByTagName('input')[0]; |
20 eventSender.mouseMoveTo(dateInput.offsetLeft + dateInput.offsetWidth - 6
, | 20 eventSender.mouseMoveTo(dateInput.offsetLeft + dateInput.offsetWidth - 6
, |
21 dateInput.offsetTop + dateInput.offsetHeight / 2
); | 21 dateInput.offsetTop + dateInput.offsetHeight / 2
); |
22 eventSender.mouseDown(); | 22 eventSender.mouseDown(); |
23 eventSender.mouseUp(); | 23 eventSender.mouseUp(); |
24 }, 0); | 24 }, 0); |
25 } | 25 } |
26 </script> | 26 </script> |
27 <script src="../../js/resources/js-test-post.js"></script> | 27 <script src="../../js/resources/js-test-post.js"></script> |
28 </body> | 28 </body> |
OLD | NEW |