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

Side by Side Diff: LayoutTests/fast/forms/select/listbox-tap-input-change-event.html

Issue 486583002: Regression: r170111 Tapping listbox items should fire change/input event (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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
« no previous file with comments | « no previous file | LayoutTests/fast/forms/select/listbox-tap-input-change-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 <!DOCTYPE html>
2 <html>
3 <body>
4 <script src="../../../resources/js-test.js"></script>
5 <select id="select1" multiple size="4">
6 <option>1</option>
7 <option>2</option>
8 <option>3</option>
9 </select>
10
11 <script>
12 description('Tapping on listbox items should fire an input and a change event.') ;
13
14 function tapOption(select, index) {
15 var itemHeight = Math.floor(select.offsetHeight / select.size);
16 var border = 1;
17 var y = border + index * itemHeight;
18
19 select.focus();
20 if (window.eventSender) {
21 eventSender.gestureTap(select.offsetLeft + border, select.offsetTop + y - window.pageYOffset + itemHeight / 2);
22 }
23 }
24
25 var select = document.getElementById('select1');
26 var changeEventCounter = 0;
27 var inputEventCounter = 0;
28
29 select.addEventListener('change', function () {
30 changeEventCounter++;
31 }, false);
32
33 select.addEventListener('input', function () {
34 inputEventCounter++;
35 }, false);
36
37 if (window.eventSender) {
38 shouldBe('changeEventCounter', '0');
39 shouldBe('inputEventCounter', '0');
40 tapOption(select, 0);
41 shouldBe('changeEventCounter', '1');
42 shouldBe('inputEventCounter', '1');
43 }
44 </script>
45
46 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/forms/select/listbox-tap-input-change-event-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698