Chromium Code Reviews| Index: LayoutTests/fast/forms/date-multiple-fields/date-multiple-fields-focusin-event.html |
| diff --git a/LayoutTests/fast/forms/date-multiple-fields/date-multiple-fields-focusin-event.html b/LayoutTests/fast/forms/date-multiple-fields/date-multiple-fields-focusin-event.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..043ce96c4e64c62b69fa677db1edd09f592c782d |
| --- /dev/null |
| +++ b/LayoutTests/fast/forms/date-multiple-fields/date-multiple-fields-focusin-event.html |
| @@ -0,0 +1,35 @@ |
| +<!DOCTYPE html> |
| +<script src="../../../resources/js-test.js"></script> |
| +<body> |
| +<input type="text" id="text" onfocusin="onfocusin()"> |
| +<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.
|
| +<input type="time" id="time" onfocusin="onfocusin()"> |
| +<script> |
| +description('Test Date/Time input field dispatches focusin event when pressed tab'); |
| +var input = document.querySelector('input'); |
| +var dispatchedFocusInEvent = 0; |
| +function onfocusin() |
| +{ |
| + dispatchedFocusInEvent++; |
| +} |
| + |
| +document.getElementById('text').focus(); |
| +shouldBeEqualToString('document.activeElement.id', 'text'); |
| +shouldBe('dispatchedFocusInEvent', '1'); |
| + |
| +debug('Move to date field, should generate foucsin event'); |
| +eventSender.keyDown('\t'); //move to date input element |
| +shouldBeEqualToString('document.activeElement.id', 'date'); |
| +shouldBe('dispatchedFocusInEvent', '2'); |
| +eventSender.keyDown('\t'); //move to date field |
| +eventSender.keyDown('\t'); //move to year field |
| + |
| +debug('Move to time field, should generate foucsin event'); |
| +eventSender.keyDown('\t'); //move to time field |
| +shouldBeEqualToString('document.activeElement.id', 'time'); |
| +shouldBe('dispatchedFocusInEvent', '3'); |
| +eventSender.keyDown('\t'); //move to hour field |
| +eventSender.keyDown('\t'); //move to am/pm field |
| + |
| +</script> |
| +</body> |