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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/forms/number/number-outofrange.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 spinbutton behavior for out-of-range values.'); 8 description('Test for spinbutton behavior for out-of-range values.');
9 9
10 var parent = document.createElement('div'); 10 var parent = document.createElement('div');
11 document.body.appendChild(parent); 11 document.body.appendChild(parent);
12 parent.innerHTML = '<input type=number id=lower value=-10 min=0 max=100>' 12 parent.innerHTML = '<input type=number id=lower value=-10 min=0 max=100>'
13 + '<input type=number id=higher value=200 min=0 max=100>'; 13 + '<input type=number id=higher value=200 min=0 max=100>';
14 var lower = document.getElementById('lower'); 14 var lower = document.getElementById('lower');
15 var higher = document.getElementById('higher'); 15 var higher = document.getElementById('higher');
16 16
17 function sendKeyEvent(element, key) 17 function sendKeyEvent(element, key)
18 { 18 {
19 element.focus(); 19 element.focus();
20 eventSender.keyDown(key); 20 eventSender.keyDown(key);
21 } 21 }
22 22
23 debug('Pressing the down arrow key on an input field of which value is lower tha n the minimum:'); 23 debug('Pressing the down arrow key on an input field of which value is lower tha n the minimum:');
24 sendKeyEvent(lower, 'downArrow'); 24 sendKeyEvent(lower, 'ArrowDown');
25 var unchanged = "-10"; 25 var unchanged = "-10";
26 shouldBe('lower.value', 'unchanged'); 26 shouldBe('lower.value', 'unchanged');
27 27
28 debug('Pressing the up arrow key on the input:'); 28 debug('Pressing the up arrow key on the input:');
29 sendKeyEvent(lower, 'upArrow'); 29 sendKeyEvent(lower, 'ArrowUp');
30 shouldBe('lower.value', 'lower.min'); 30 shouldBe('lower.value', 'lower.min');
31 31
32 debug('Pressing the up arrow key on an input field of which value is higher than the maximum:'); 32 debug('Pressing the up arrow key on an input field of which value is higher than the maximum:');
33 sendKeyEvent(higher, 'upArrow'); 33 sendKeyEvent(higher, 'ArrowUp');
34 unchanged = "200"; 34 unchanged = "200";
35 shouldBe('higher.value', 'unchanged'); 35 shouldBe('higher.value', 'unchanged');
36 36
37 debug('Pressing the down arrow key on the input:'); 37 debug('Pressing the down arrow key on the input:');
38 sendKeyEvent(higher, 'downArrow'); 38 sendKeyEvent(higher, 'ArrowDown');
39 shouldBe('higher.value', 'higher.max'); 39 shouldBe('higher.value', 'higher.max');
40 40
41 parent.innerHTML = ''; 41 parent.innerHTML = '';
42 </script> 42 </script>
43 </body> 43 </body>
44 </html> 44 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698