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

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: 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 side-by-side diff with in-line comments
Download patch
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>

Powered by Google App Engine
This is Rietveld 408576698