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

Unified Diff: LayoutTests/fast/forms/time-multiple-fields/time-multiple-fields-keyboard-events.html

Issue 12047073: Merge 140324 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1364/
Patch Set: Created 7 years, 11 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/time-multiple-fields/time-multiple-fields-keyboard-events-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/forms/time-multiple-fields/time-multiple-fields-keyboard-events.html
===================================================================
--- LayoutTests/fast/forms/time-multiple-fields/time-multiple-fields-keyboard-events.html (revision 140648)
+++ LayoutTests/fast/forms/time-multiple-fields/time-multiple-fields-keyboard-events.html (working copy)
@@ -41,12 +41,26 @@
input.focus();
}
+var eventsCounter = {};
+function countEvents(event)
+{
+ if (eventsCounter[event.type] === undefined)
+ eventsCounter[event.type] = 0;
+ eventsCounter[event.type]++;
+}
+input.addEventListener('input', countEvents, false);
+input.addEventListener('change', countEvents, false);
+
beginTest('Digit keys');
-keyDown('7');
-keyDown('5');
-keyDown('6');
-keyDown('A');
+keyDown('7'); // -> 07:[--] --
+keyDown('5'); // -> 07:[05] --
+keyDown('6'); // -> 07:56 [--]
+shouldBeUndefined('eventsCounter.input');
+shouldBeUndefined('eventsCounter.change');
+keyDown('A'); // -> 07:56 [AM]
shouldBeEqualToString('input.value', '07:56');
+shouldBe('eventsCounter.input', '1');
+shouldBe('eventsCounter.change', '1');
beginTest('Digit keys starting with zero');
keyDown('0'); // -> [00]:-- --
@@ -97,14 +111,19 @@
shouldBeEqualToString('input.value', '03:56');
beginTest('Up/Down keys on empty value', '');
-keyDown('upArrow');
-keyDown('upArrow');
-keyDown('rightArrow');
-keyDown('downArrow');
-keyDown('downArrow');
-keyDown('rightArrow');
-keyDown('downArrow');
+eventsCounter = {};
+keyDown('upArrow'); // -> [01]:-- --
+keyDown('upArrow'); // -> [02]:-- --
+keyDown('rightArrow'); // -> 02:[--] --
+keyDown('downArrow'); // -> 02:[59] --
+keyDown('downArrow'); // -> 02:[58] --
+keyDown('rightArrow'); // -> 02:58 [--]
+shouldBeUndefined('eventsCounter.input');
+shouldBeUndefined('eventsCounter.change');
+keyDown('downArrow'); // -> 02:58 [PM]
shouldBeEqualToString('input.value', '14:58');
+shouldBe('eventsCounter.input', '1');
+shouldBe('eventsCounter.change', '1');
beginTest('Tab key', '03:00');
keyDown('\t');
« no previous file with comments | « no previous file | LayoutTests/fast/forms/time-multiple-fields/time-multiple-fields-keyboard-events-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698