| OLD | NEW | 
|---|
| (Empty) |  | 
|  | 1 <!DOCTYPE> | 
|  | 2 <html> | 
|  | 3 <body> | 
|  | 4 <script src="../resources/common.js"></script> | 
|  | 5 <script src="../../../resources/js-test.js"></script> | 
|  | 6 <input type="textfield" id="text" onchange="handleChangeEvent(this);" value="val
    ue"> | 
|  | 7 <input type="reset" id="reset"> | 
|  | 8 <script> | 
|  | 9 description('In a text field after reset when whole text is deleted i.e. text va
    lue is empty. When out of focus, it should dispatch change event'); | 
|  | 10 | 
|  | 11 var changeEventCounter = 0; | 
|  | 12 | 
|  | 13 function handleChangeEvent(element) { | 
|  | 14     ++changeEventCounter; | 
|  | 15 } | 
|  | 16 | 
|  | 17 var reset = document.getElementById('reset'); | 
|  | 18 var text = document.getElementById('text'); | 
|  | 19 | 
|  | 20 debug('Press reset button'); | 
|  | 21 clickElement(reset); | 
|  | 22 | 
|  | 23 text.focus(); | 
|  | 24 shouldBeEqualToString('text.value', 'value'); | 
|  | 25 shouldBe('changeEventCounter', '0'); | 
|  | 26 | 
|  | 27 debug('Delete the whole text'); | 
|  | 28 document.execCommand('SelectAll', false, null); | 
|  | 29 document.execCommand('Delete', false, null); | 
|  | 30 | 
|  | 31 debug('Out of focus from text field'); | 
|  | 32 reset.focus(); | 
|  | 33 shouldBeEqualToString('text.value', ''); | 
|  | 34 shouldBe('changeEventCounter', '1'); | 
|  | 35 | 
|  | 36 </script> | 
|  | 37 </body> | 
|  | 38 </html> | 
| OLD | NEW | 
|---|