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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/forms/range/range-stepup-stepdown-from-renderer.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 <input id="test"></input> 7 <input id="test"></input>
8 <p id="description"></p> 8 <p id="description"></p>
9 <div id="console"></div> 9 <div id="console"></div>
10 <script> 10 <script>
(...skipping 13 matching lines...) Expand all
24 input.max = max; 24 input.max = max;
25 input.step = step; 25 input.step = step;
26 input.value = value; 26 input.value = value;
27 } 27 }
28 28
29 function stepUp(value, step, max, optionalStepCount) { 29 function stepUp(value, step, max, optionalStepCount) {
30 setInputAttributes(null, max, step, value); 30 setInputAttributes(null, max, step, value);
31 if (typeof optionalStepCount != "undefined") 31 if (typeof optionalStepCount != "undefined")
32 if (optionalStepCount < 0) 32 if (optionalStepCount < 0)
33 for (var i = 0; i < -optionalStepCount; i++) 33 for (var i = 0; i < -optionalStepCount; i++)
34 sendKey('downArrow'); 34 sendKey('ArrowDown');
35 else 35 else
36 for (var i = 0; i < optionalStepCount; i++) 36 for (var i = 0; i < optionalStepCount; i++)
37 sendKey('upArrow'); 37 sendKey('ArrowUp');
38 else 38 else
39 sendKey('upArrow'); 39 sendKey('ArrowUp');
40 return input.value; 40 return input.value;
41 } 41 }
42 42
43 function stepDown(value, step, min, optionalStepCount) { 43 function stepDown(value, step, min, optionalStepCount) {
44 setInputAttributes(min, null, step, value); 44 setInputAttributes(min, null, step, value);
45 if (typeof optionalStepCount != "undefined") 45 if (typeof optionalStepCount != "undefined")
46 if (optionalStepCount < 0) 46 if (optionalStepCount < 0)
47 for (var i = 0; i < -optionalStepCount; i++) 47 for (var i = 0; i < -optionalStepCount; i++)
48 sendKey('upArrow'); 48 sendKey('ArrowUp');
49 else 49 else
50 for (var i = 0; i < optionalStepCount; i++) 50 for (var i = 0; i < optionalStepCount; i++)
51 sendKey('downArrow'); 51 sendKey('ArrowDown');
52 else 52 else
53 sendKey('downArrow'); 53 sendKey('ArrowDown');
54 return input.value; 54 return input.value;
55 } 55 }
56 56
57 // Range value gets automatically shifted based on bounds, 57 // Range value gets automatically shifted based on bounds,
58 // So always set the min and max first to get expected behavior 58 // So always set the min and max first to get expected behavior
59 59
60 function stepUpExplicitBounds(min, max, step, value, stepCount) { 60 function stepUpExplicitBounds(min, max, step, value, stepCount) {
61 setInputAttributes(min, max, step, value); 61 setInputAttributes(min, max, step, value);
62 if (typeof stepCount !== 'undefined') 62 if (typeof stepCount !== 'undefined')
63 if (stepCount < 0) { 63 if (stepCount < 0) {
64 for (var i = 0; i < -stepCount; i++) 64 for (var i = 0; i < -stepCount; i++)
65 sendKey('downArrow'); 65 sendKey('ArrowDown');
66 } else { 66 } else {
67 for (var i = 0; i < stepCount; i++) 67 for (var i = 0; i < stepCount; i++)
68 sendKey('upArrow'); 68 sendKey('ArrowUp');
69 } 69 }
70 else 70 else
71 sendKey('upArrow'); 71 sendKey('ArrowUp');
72 return input.value; 72 return input.value;
73 } 73 }
74 74
75 function stepDownExplicitBounds(min, max, step, value, stepCount) { 75 function stepDownExplicitBounds(min, max, step, value, stepCount) {
76 setInputAttributes(min, max, step, value); 76 setInputAttributes(min, max, step, value);
77 if (typeof stepCount !== 'undefined') 77 if (typeof stepCount !== 'undefined')
78 if (stepCount < 0) { 78 if (stepCount < 0) {
79 for (var i = 0; i < -stepCount; i++) 79 for (var i = 0; i < -stepCount; i++)
80 sendKey('upArrow'); 80 sendKey('ArrowUp');
81 } else { 81 } else {
82 for (var i = 0; i < stepCount; i++) 82 for (var i = 0; i < stepCount; i++)
83 sendKey('downArrow'); 83 sendKey('ArrowDown');
84 } 84 }
85 else 85 else
86 sendKey('downArrow'); 86 sendKey('ArrowDown');
87 return input.value; 87 return input.value;
88 } 88 }
89 89
90 input.type = 'range'; 90 input.type = 'range';
91 debug('Function arguments are (min, max, step, value, [stepCount]).'); 91 debug('Function arguments are (min, max, step, value, [stepCount]).');
92 debug('Using the default values'); 92 debug('Using the default values');
93 shouldBe('stepUpExplicitBounds(null, null, null, "")', '"51"'); 93 shouldBe('stepUpExplicitBounds(null, null, null, "")', '"51"');
94 shouldBe('stepDownExplicitBounds(null, null, null, "")', '"49"'); 94 shouldBe('stepDownExplicitBounds(null, null, null, "")', '"49"');
95 shouldBe('stepUpExplicitBounds(null, null, "any", "")', '"51"'); 95 shouldBe('stepUpExplicitBounds(null, null, "any", "")', '"51"');
96 shouldBe('stepDownExplicitBounds(null, null, "any", "")', '"49"'); 96 shouldBe('stepDownExplicitBounds(null, null, "any", "")', '"49"');
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 shouldBe('stepUpExplicitBounds(null, null, 0.1, 1, 8)', '"1.8"'); 146 shouldBe('stepUpExplicitBounds(null, null, 0.1, 1, 8)', '"1.8"');
147 shouldBe('stepUpExplicitBounds(null, null, 0.1, 1, 10)', '"2"'); 147 shouldBe('stepUpExplicitBounds(null, null, 0.1, 1, 10)', '"2"');
148 shouldBe('stepUpExplicitBounds(0, 1, 0.003921568627450980, 0, 255)', '"1"'); 148 shouldBe('stepUpExplicitBounds(0, 1, 0.003921568627450980, 0, 255)', '"1"');
149 shouldBe('stepDownExplicitBounds(null, null, 0.1, 1, 8)', '"0.2"'); 149 shouldBe('stepDownExplicitBounds(null, null, 0.1, 1, 8)', '"0.2"');
150 shouldBe('stepDownExplicitBounds(null, null, 0.1, 1)', '"0.9"'); 150 shouldBe('stepDownExplicitBounds(null, null, 0.1, 1)', '"0.9"');
151 151
152 debug(''); 152 debug('');
153 </script> 153 </script>
154 </body> 154 </body>
155 </html> 155 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698