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

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: Updated to latest master and updated test 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
« no previous file with comments | « no previous file | LayoutTests/fast/forms/date-multiple-fields/date-multiple-fields-focusin-event-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../../../resources/js-test.js"></script>
3 <body>
4 <form>
5 <input type="text" id="text">
6 <input type="date" id="date">
7 <input type="time" id="time">
8 </form>
9 <script>
10 description('Test Date/Time input field dispatches focusin event when pressed ta b');
11 var dispatchedFocusInEvent = 0;
12 var dispatchedDOMFocusInEvent = 0;
13
14 document.documentElement.addEventListener('focusin', focusin, false);
15 document.documentElement.addEventListener('DOMFocusIn', domfocusin, false);
16
17 function focusin()
18 {
19 dispatchedFocusInEvent++;
20 }
21
22 function domfocusin()
23 {
24 dispatchedDOMFocusInEvent++;
25 }
26
27 document.getElementById('text').focus();
28 shouldBeEqualToString('document.activeElement.id', 'text');
29 shouldBe('dispatchedFocusInEvent', '1');
30 shouldBe('dispatchedDOMFocusInEvent', '1');
31
32 debug('Move to date field, should generate foucsin event');
33 eventSender.keyDown('\t'); // move to date input element.
34 shouldBeEqualToString('document.activeElement.id', 'date');
35 shouldBe('dispatchedFocusInEvent', '2');
36 shouldBe('dispatchedDOMFocusInEvent', '2');
37 eventSender.keyDown('\t'); // move to date field.
38 eventSender.keyDown('\t'); // move to year field.
39
40 debug('Move to time field, should generate foucsin event');
41 eventSender.keyDown('\t'); // move to time field.
42 shouldBeEqualToString('document.activeElement.id', 'time');
43 shouldBe('dispatchedFocusInEvent', '3');
44 shouldBe('dispatchedDOMFocusInEvent', '3');
45
46 </script>
47 </body>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/forms/date-multiple-fields/date-multiple-fields-focusin-event-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698