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

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

Issue 2100243002: Remove non-standardize key code names from event_sender. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix inspector tests that were missed by sed Created 4 years, 5 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
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 shouldBeEqualToString('input.value', '123'); 17 shouldBeEqualToString('input.value', '123');
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('ArrowUp');
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('ArrowDown');
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:'); 28 debug('Press the down and alt arrow key, should not decrement value:');
29 eventSender.keyDown('downArrow', ['altKey']); 29 eventSender.keyDown('ArrowDown', ['altKey']);
30 shouldBeEqualToString('input.value', '123'); 30 shouldBeEqualToString('input.value', '123');
31 31
32 debug('Disable input element:'); 32 debug('Disable input element:');
33 input.disabled = true; 33 input.disabled = true;
34 eventSender.keyDown('upArrow'); 34 eventSender.keyDown('ArrowUp');
35 shouldBe('input.value', '"123"'); 35 shouldBe('input.value', '"123"');
36 input.removeAttribute('disabled'); 36 input.removeAttribute('disabled');
37 37
38 debug('Read-only input element:'); 38 debug('Read-only input element:');
39 input.readOnly = true; 39 input.readOnly = true;
40 eventSender.keyDown('upArrow'); 40 eventSender.keyDown('ArrowUp');
41 shouldBe('input.value', '"123"'); 41 shouldBe('input.value', '"123"');
42 </script> 42 </script>
43 </body> 43 </body>
44 </html> 44 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698