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

Side by Side Diff: LayoutTests/fast/forms/range/range-keyboard-oninput-event.html

Issue 178593003: Dispatch input event for Range element keyboard event (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updated test to use event.type and corrected format Created 6 years, 9 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/range/range-keyboard-oninput-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 <html>
2 <head>
3 <script src="../../../resources/js-test.js"></script>
4 </head>
5 <body>
6 <input type="range" id="slider" oninput="log(event)" onchange="log(event)" min= 0 max=100 value=50>
7 <script>
8 description('Test that for each keyboard event both input and change event a re dispatched');
tkent 2014/03/04 22:24:28 nit: You don't need to indent the whole content of
9 var changeEventCounter = 0;
10 var lastChangeEventCounter = changeEventCounter;
11 var inputEventCounter = 0;
12 var lastInputEventCounter = inputEventCounter;
13
14 function log(event) {
15 if (event.type == 'input')
16 inputEventCounter++;
17 if (event.type == 'change')
18 changeEventCounter++;
19 }
20
21 function testInput() {
22 var slider = document.getElementById('slider');
23 if (window.testRunner) {
24 // slider drag
25 slider.focus();
26 debug('Move left');
27 eventSender.keyDown('leftArrow');
28 shouldBeGreaterThanOrEqual('inputEventCounter' , 'lastInputEventCoun ter + 1');
29 shouldBeGreaterThanOrEqual('changeEventCounter', 'lastChangeEventCou nter + 1');
30 debug('Move right');
31 lastInputEventCounter = inputEventCounter;
32 lastChangeEventCounter = changeEventCounter;
33 eventSender.keyDown('rightArrow');
34 shouldBeGreaterThanOrEqual('inputEventCounter' , 'lastInputEventCoun ter + 1');
35 shouldBeGreaterThanOrEqual('changeEventCounter', 'lastChangeEventCou nter + 1');
36 }
37 }
38 testInput();
39 </script>
40 </body>
41 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/forms/range/range-keyboard-oninput-event-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698