Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(164)

Side by Side Diff: LayoutTests/fast/forms/date-multiple-fields/date-multiple-fields-focusin-event.html

Issue 541993003: Generate focusin for input type=date/time when selected by tab (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Moved code to HTMLInputElement Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698