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

Side by Side Diff: LayoutTests/fast/forms/number/number-keyoperation.html

Issue 218683010: Using alt and down key to open datalist using keyboard (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updated as per code review commnets Created 6 years, 8 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/number/number-keyoperation-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
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <head> 3 <head>
4 <script src="../../../resources/js-test.js"></script> 4 <script src="../../../resources/js-test.js"></script>
5 </head> 5 </head>
6 <body> 6 <body>
7 <script> 7 <script>
8 description('Test for keyboard operations for &lt;input type=number>'); 8 description('Test for keyboard operations for &lt;input type=number>');
9 var parent = document.createElement('div'); 9 var parent = document.createElement('div');
10 document.body.appendChild(parent); 10 document.body.appendChild(parent);
11 parent.innerHTML = '<input type=number id=number>'; 11 parent.innerHTML = '<input type=number id=number>';
12 12
13 var input = document.getElementById('number'); 13 var input = document.getElementById('number');
14 input.focus(); 14 input.focus();
15 debug('Inserting "ab123cd":'); 15 debug('Inserting "ab123cd":');
16 document.execCommand('InsertText', false, 'ab123cd'); 16 document.execCommand('InsertText', false, 'ab123cd');
17 shouldBe('input.value', '""'); 17 shouldBe('input.value', '""');
18 18
19 debug('Press the up arrow key:'); 19 debug('Press the up arrow key:');
20 input.valueAsNumber = 123; 20 input.valueAsNumber = 123;
21 eventSender.keyDown('upArrow'); 21 eventSender.keyDown('upArrow');
22 shouldBe('input.value', '"124"'); 22 shouldBe('input.value', '"124"');
23 23
24 debug('Press the down arrow key:'); 24 debug('Press the down arrow key:');
25 eventSender.keyDown('downArrow'); 25 eventSender.keyDown('downArrow');
26 shouldBe('input.value', '"123"'); 26 shouldBe('input.value', '"123"');
27 27
28 debug('Press the down and alt arrow key, should not decrement value:');
29 eventSender.keyDown('downArrow', ['altKey']);
30 shouldBeEqualToString('input.value', '123');
31
28 debug('Disable input element:'); 32 debug('Disable input element:');
29 input.disabled = true; 33 input.disabled = true;
30 eventSender.keyDown('upArrow'); 34 eventSender.keyDown('upArrow');
31 shouldBe('input.value', '"123"'); 35 shouldBe('input.value', '"123"');
32 input.removeAttribute('disabled'); 36 input.removeAttribute('disabled');
33 37
34 debug('Read-only input element:'); 38 debug('Read-only input element:');
35 input.readOnly = true; 39 input.readOnly = true;
36 eventSender.keyDown('upArrow'); 40 eventSender.keyDown('upArrow');
37 shouldBe('input.value', '"123"'); 41 shouldBe('input.value', '"123"');
38 </script> 42 </script>
39 </body> 43 </body>
40 </html> 44 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/forms/number/number-keyoperation-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698