Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <script src="../../../resources/js-test.js"></script> | |
| 3 <body> | |
| 4 <input type="text" id="text" onfocusin="onfocusin()"> | |
| 5 <input type="date" id="date" onfocusin="onfocusin()"> | |
|
tkent
2014/09/10 23:47:10
Please listen to DOMFocusIn event too.
Habib Virji
2014/09/11 09:12:22
Done.
| |
| 6 <input type="time" id="time" onfocusin="onfocusin()"> | |
| 7 <script> | |
| 8 description('Test Date/Time input field dispatches focusin event when pressed ta b'); | |
| 9 var input = document.querySelector('input'); | |
| 10 var dispatchedFocusInEvent = 0; | |
| 11 function onfocusin() | |
| 12 { | |
| 13 dispatchedFocusInEvent++; | |
| 14 } | |
| 15 | |
| 16 document.getElementById('text').focus(); | |
| 17 shouldBeEqualToString('document.activeElement.id', 'text'); | |
| 18 shouldBe('dispatchedFocusInEvent', '1'); | |
| 19 | |
| 20 debug('Move to date field, should generate foucsin event'); | |
| 21 eventSender.keyDown('\t'); //move to date input element | |
| 22 shouldBeEqualToString('document.activeElement.id', 'date'); | |
| 23 shouldBe('dispatchedFocusInEvent', '2'); | |
| 24 eventSender.keyDown('\t'); //move to date field | |
| 25 eventSender.keyDown('\t'); //move to year field | |
| 26 | |
| 27 debug('Move to time field, should generate foucsin event'); | |
| 28 eventSender.keyDown('\t'); //move to time field | |
| 29 shouldBeEqualToString('document.activeElement.id', 'time'); | |
| 30 shouldBe('dispatchedFocusInEvent', '3'); | |
| 31 eventSender.keyDown('\t'); //move to hour field | |
| 32 eventSender.keyDown('\t'); //move to am/pm field | |
| 33 | |
| 34 </script> | |
| 35 </body> | |
| OLD | NEW |