Fix an assertion failure in CalendarPickerElement::hostInput().
[WebKit-https.git] / LayoutTests / fast / forms / date / calendar-picker-type-change-onclick.html
1 <!DOCTYPE html>
2 <body>
3 <script src="../../js/resources/js-test-pre.js"></script>
4 <input type="date" onclick="changeType(this)" />
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.');
7
8 function changeType(input) {
9     input.type = 'text';
10     testPassed('unless crash or assertion failure');
11     finishJSTest();
12 }
13
14 jsTestIsAsync = true;
15 if (!window.eventSender) {
16     debug('Click on the triangle in the input field.');
17 } else {
18     setTimeout(function() {
19         var dateInput = document.getElementsByTagName('input')[0];
20         eventSender.mouseMoveTo(dateInput.offsetLeft + dateInput.offsetWidth - 6,
21                                 dateInput.offsetTop + dateInput.offsetHeight / 2);
22         eventSender.mouseDown();
23         eventSender.mouseUp();
24     }, 0);
25 }
26 </script>
27 <script src="../../js/resources/js-test-post.js"></script>
28 </body>