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

Unified 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..519cef955c3a7323816ed19f9d75825ed7d4347a
--- /dev/null
+++ b/LayoutTests/fast/forms/date-multiple-fields/date-multiple-fields-focusin-event.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<script src="../../../resources/js-test.js"></script>
+<body>
+<form>
+<input type="text" id="text">
+<input type="date" id="date">
+<input type="time" id="time">
+</form>
+<script>
+description('Test Date/Time input field dispatches focusin event when pressed tab');
+var dispatchedFocusInEvent = 0;
+var dispatchedDOMFocusInEvent = 0;
+
+document.documentElement.addEventListener('focusin', focusin, false);
+document.documentElement.addEventListener('DOMFocusIn', domfocusin, false);
+
+function focusin()
+{
+ dispatchedFocusInEvent++;
+}
+
+function domfocusin()
+{
+ dispatchedDOMFocusInEvent++;
+}
+
+document.getElementById('text').focus();
+shouldBeEqualToString('document.activeElement.id', 'text');
+shouldBe('dispatchedFocusInEvent', '1');
+shouldBe('dispatchedDOMFocusInEvent', '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');
+shouldBe('dispatchedDOMFocusInEvent', '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');
+shouldBe('dispatchedDOMFocusInEvent', '3');
+
+</script>
+</body>
« 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