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=
"value">
7 <input type=
"reset" id=
"reset">
9 description('In a text field after reset when whole text is deleted i.e. text value is empty. When out of focus, it should dispatch change event');
11 var changeEventCounter
= 0;
13 function handleChangeEvent(element
) {
17 var reset
= document
.getElementById('reset');
18 var text
= document
.getElementById('text');
20 debug('Press reset button');
24 shouldBeEqualToString('text.value', 'value');
25 shouldBe('changeEventCounter', '0');
27 debug('Delete the whole text');
28 document
.execCommand('SelectAll', false, null);
29 document
.execCommand('Delete', false, null);
31 debug('Out of focus from text field');
33 shouldBeEqualToString('text.value', '');
34 shouldBe('changeEventCounter', '1');