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

Side by Side Diff: LayoutTests/fast/forms/time-multiple-fields/time-multiple-fields-choose-default-value-after-set-value.html

Issue 23851005: Change event isn't firing when the user reverts the value of a color/date/time input after JS cha… (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: updated test expectation Created 7 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../../fast/js/resources/js-test-pre.js"></script>
5 <script src="../resources/common.js"></script>
6 </head>
7 <body>
8 <p id="description"></p>
9 <div id="console"></div>
10 <input type="time" id="input" value="01:01:01">
11 <script>
12 description('Test if change event fires when the user selects the default value after the value was changed by JS.');
13
14 var eventsCounter = {};
15 function recordEvent(event) {
16 if (eventsCounter[event.type] === undefined)
17 eventsCounter[event.type] = 0;
18 eventsCounter[event.type]++;
19 debug('==> "' + event.type + '" event was dispatched.');
20 }
21
22 var input = document.getElementById('input');
23 input.addEventListener('input', recordEvent, false);
24 input.addEventListener('change', recordEvent, false);
25
26 input.value = '02:01:01';
27
28 shouldBeEqualToString('input.value', '02:01:01');
29 shouldBeUndefined('eventsCounter.input');
30 shouldBeUndefined('eventsCounter.change');
31
32 // We assume the date format is h:m a.
33
34 input.focus();
35 eventSender.keyDown('downArrow');
36
37 shouldBeEqualToString('input.value', '01:01:01');
38 shouldBe('eventsCounter.input', '1');
39 shouldBe('eventsCounter.change', '1');
40
41 </script>
42 <script src="../../../fast/js/resources/js-test-post.js"></script>
43 </body>
44 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698