OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE> |
| 2 <html> |
| 3 <body> |
| 4 <script src="../../../resources/js-test.js"></script> |
| 5 <input type="number" id="num1" onchange="handleChangeEvent(this);" oninput="hand
leInputEvent(this);"> |
| 6 <script> |
| 7 var changeEventCounter = 0; |
| 8 var inputEventCounter = 0; |
| 9 |
| 10 function handleChangeEvent(element){ |
| 11 ++changeEventCounter; |
| 12 } |
| 13 |
| 14 function handleInputEvent(element){ |
| 15 ++inputEventCounter; |
| 16 } |
| 17 |
| 18 var numberInput1= document.getElementById('num1'); |
| 19 numberInput1.focus(); |
| 20 eventSender.mouseMoveTo(0, 0); |
| 21 eventSender.mouseMoveTo(numberInput1.offsetLeft + numberInput1.offsetWidth - 10,
numberInput1.offsetTop + numberInput1.offsetHeight / 4); |
| 22 eventSender.mouseDown(); |
| 23 debug('Only input event occurs on mouse down'); |
| 24 shouldBe('inputEventCounter', '1'); |
| 25 shouldBe('changeEventCounter', '0'); |
| 26 debug('Only change event occurs on mouse up'); |
| 27 eventSender.mouseUp(); |
| 28 shouldBe('inputEventCounter', '1'); |
| 29 shouldBe('changeEventCounter', '1'); |
| 30 |
| 31 </script> |
| 32 </body> |
| 33 </html> |
OLD | NEW |