Changeset 55423 in webkit
- Timestamp:
- Mar 2, 2010 12:31:57 PM (14 years ago)
- Location:
- trunk/LayoutTests
- Files:
-
- 18 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r55414 r55423 1 2010-03-02 Kent Tamura <tkent@chromium.org> 2 3 Reviewed by Shinichiro Hamaji. 4 5 Merge ValidityState-stepMismatch-{number,range,unsupported}.html and 6 input-step-{number,range,unsupported}.html to other tests 7 https://bugs.webkit.org/show_bug.cgi?id=35435 8 9 - Merge ValidityState-stepMismatch-{number,range,unsupported}.html to 10 ValidityState-stepMismatch.html 11 - Merge input-step--{number,range,unsupported}.html to input-step.html 12 13 * fast/forms/ValidityState-stepMismatch-expected.txt: 14 * fast/forms/ValidityState-stepMismatch-number-expected.txt: Removed. 15 * fast/forms/ValidityState-stepMismatch-number.html: Removed. 16 * fast/forms/ValidityState-stepMismatch-range-expected.txt: Removed. 17 * fast/forms/ValidityState-stepMismatch-range.html: Removed. 18 * fast/forms/ValidityState-stepMismatch-unsupported-expected.txt: Removed. 19 * fast/forms/ValidityState-stepMismatch-unsupported.html: Removed. 20 * fast/forms/input-step-number-expected.txt: Removed. 21 * fast/forms/input-step-number.html: Removed. 22 * fast/forms/input-step-range-expected.txt: Removed. 23 * fast/forms/input-step-range.html: Removed. 24 * fast/forms/input-step-unsupported-expected.txt: Removed. 25 * fast/forms/input-step-unsupported.html: Removed. 26 * fast/forms/input-stepup-stepdown-expected.txt: 27 * fast/forms/script-tests/ValidityState-stepMismatch-number.js: Removed. 28 * fast/forms/script-tests/ValidityState-stepMismatch-range.js: Removed. 29 * fast/forms/script-tests/ValidityState-stepMismatch-unsupported.js: Removed. 30 * fast/forms/script-tests/ValidityState-stepMismatch.js: 31 * fast/forms/script-tests/input-step-number.js: Removed. 32 * fast/forms/script-tests/input-step-range.js: Removed. 33 * fast/forms/script-tests/input-step-unsupported.js: Removed. 34 * fast/forms/script-tests/input-stepup-stepdown.js: 35 1 36 2010-03-02 Brady Eidson <beidson@apple.com> 2 37 -
trunk/LayoutTests/fast/forms/ValidityState-stepMismatch-expected.txt
r54647 r55423 114 114 PASS stepMismatchFor("2010-03", "any", "2010-02") is false 115 115 116 Number type 117 Empty values 118 PASS stepMismatchFor("", null, null) is false 119 PASS stepMismatchFor("", "1.0", "0.1") is false 120 Integers 121 PASS stepMismatchFor("1", "2", "0") is true 122 PASS stepMismatchFor("-3", "2", "-4") is true 123 PASS input.max = "5"; stepMismatchFor("5", "3", "0") is true 124 PASS input.value is "5" 125 Invalid step values 126 PASS stepMismatchFor("-3", "-2", "-4") is false 127 PASS stepMismatchFor("-3", null, "-4") is false 128 PASS stepMismatchFor("-3", undefined, "-4") is false 129 Huge numbers and small step; uncomparable 130 PASS stepMismatchFor("1.7976931348623157e+308", "3", "") is false 131 PASS stepMismatchFor("1.7976931348623156e+308", "3", "") is false 132 PASS stepMismatchFor("1.7976931348623155e+308", "3", "") is false 133 Huge numbers and huge step 134 PASS stepMismatchFor("1.60e+308", "0.20e+308", "") is false 135 PASS stepMismatchFor("1.60e+308", "0.22e+308", "") is true 136 Fractional numbers 137 PASS stepMismatchFor("0.9", "0.1", "") is false 138 PASS stepMismatchFor("0.9", "0.1000001", "") is true 139 PASS stepMismatchFor("0.9", "0.1000000000000001", "") is false 140 PASS stepMismatchFor("1.0", "0.3333333333333333", "") is false 141 142 Range type 143 Empty values 144 PASS stepMismatchFor("", null, null) is false 145 PASS stepMismatchFor("", "1.0", "0.1") is false 146 Integers 147 PASS stepMismatchFor("1", "2", "0") is false 148 PASS stepMismatchFor("-3", "2", "-4") is false 149 PASS input.max = "5"; stepMismatchFor("5", "3", "0") is false 150 PASS input.value is "3" 151 Invalid step values 152 PASS stepMismatchFor("-3", "-2", "-4") is false 153 PASS stepMismatchFor("-3", null, "-4") is false 154 PASS stepMismatchFor("-3", undefined, "-4") is false 155 Huge numbers and small step; uncomparable 156 PASS stepMismatchFor("1.7976931348623157e+308", "3", "") is false 157 PASS stepMismatchFor("1.7976931348623156e+308", "3", "") is false 158 PASS stepMismatchFor("1.7976931348623155e+308", "3", "") is false 159 Huge numbers and huge step 160 PASS stepMismatchFor("1.60e+308", "0.20e+308", "") is false 161 PASS stepMismatchFor("1.60e+308", "0.22e+308", "") is false 162 Fractional numbers 163 PASS stepMismatchFor("0.9", "0.1", "") is false 164 PASS stepMismatchFor("0.9", "0.1000001", "") is false 165 PASS stepMismatchFor("0.9", "0.1000000000000001", "") is false 166 PASS stepMismatchFor("1.0", "0.3333333333333333", "") is false 167 116 168 Time type 117 169 Empty values … … 170 222 Special step value 171 223 PASS stepMismatchFor("2010-W03", "any", "2010-W02") is false 224 225 Unsupported types 226 PASS input.type = "text"; input.step = "3"; input.min = ""; input.value = "2"; input.validity.stepMismatch is false 227 PASS input.type = "button"; input.validity.stepMismatch is false 228 PASS input.type = "checkbox"; input.validity.stepMismatch is false 229 PASS input.type = "color"; input.validity.stepMismatch is false 230 PASS input.type = "email"; input.validity.stepMismatch is false 231 PASS input.type = "hidden"; input.validity.stepMismatch is false 232 PASS input.type = "image"; input.validity.stepMismatch is false 233 PASS input.type = "khtml_isindex"; input.validity.stepMismatch is false 234 PASS input.type = "passwd"; input.validity.stepMismatch is false 235 PASS input.type = "radio"; input.validity.stepMismatch is false 236 PASS input.type = "reset"; input.validity.stepMismatch is false 237 PASS input.type = "search"; input.validity.stepMismatch is false 238 PASS input.type = "submit"; input.validity.stepMismatch is false 239 PASS input.type = "tel"; input.validity.stepMismatch is false 240 PASS input.type = "url"; input.validity.stepMismatch is false 241 PASS input.type = "file"; input.validity.stepMismatch is false 172 242 PASS successfullyParsed is true 173 243 -
trunk/LayoutTests/fast/forms/input-stepup-stepdown-expected.txt
r54647 r55423 112 112 PASS stepDown("2010-02", "1", "2010-02") threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 113 113 114 Number type 115 Invalid value 116 PASS stepUp("", null, null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 117 PASS stepDown("", null, null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 118 Non-number arguments 119 PASS stepUp("0", null, null, "0") is "0" 120 PASS stepDown("0", null, null, "0") is "0" 121 PASS stepUp("0", null, null, "foo") is "0" 122 PASS stepDown("0", null, null, "foo") is "0" 123 PASS stepUp("0", null, null, null) is "0" 124 PASS stepDown("0", null, null, null) is "0" 125 Normal cases 126 PASS stepUp("0", null, null) is "1" 127 PASS stepUp("1", null, null, 2) is "3" 128 PASS stepUp("3", null, null, -1) is "2" 129 PASS stepDown("2", null, null) is "1" 130 PASS stepDown("1", null, null, 2) is "-1" 131 PASS stepDown("-1", null, null, -1) is "0" 132 Extra arguments 133 PASS input.value = "0"; input.min = null; input.step = null; input.stepUp(1, 2); input.value is "1" 134 PASS input.value = "1"; input.stepDown(1, 3); input.value is "0" 135 Invalid step value 136 PASS stepUp("0", "foo", null) is "1" 137 PASS stepUp("1", "0", null) is "2" 138 PASS stepUp("2", "-1", null) is "3" 139 Step=any 140 PASS stepUp("0", "any", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 141 PASS stepDown("0", "any", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 142 Overflow/underflow 143 PASS stepDown("1", "1", "0") is "0" 144 PASS stepDown("0", "1", "0") threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 145 PASS stepDown("1", "1", "0", 2) threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 146 PASS input.value is "1" 147 PASS stepDown("1", "1.7976931348623156e+308", "", 2) threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 148 PASS stepUp("-1", "1", "0") is "0" 149 PASS stepUp("0", "1", "0") threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 150 PASS stepUp("-1", "1", "0", 2) threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 151 PASS input.value is "-1" 152 PASS stepUp("1", "1.7976931348623156e+308", "", 2) threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 153 stepDown()/stepUp() for stepMismatch values 154 PASS stepUp("1", "2", "") is "4" 155 PASS input.stepDown(); input.value is "2" 156 PASS input.min = "0"; stepUp("9", "10", "", 9) is "100" 157 PASS stepDown("19", "10", "0") is "10" 158 PASS stepUp("89", "10", "99") threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 159 Huge value and small step 160 PASS input.min = ""; stepUp("1e+308", "1", "", 999999) is "1e+308" 161 PASS input.max = ""; stepDown("1e+308", "1", "", 999999) is "1e+308" 162 Fractional numbers 163 PASS input.min = ""; stepUp("0", "0.33333333333333333", "", 3) is "1" 164 PASS stepUp("1", "0.1", "", 10) is "2" 165 PASS input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.value is "3" 166 PASS input.min = "0"; stepUp("0", "0.003921568627450980", "1", 255) is "1" 167 PASS for (var i = 0; i < 255; i++) { input.stepDown(); }; input.value is "0" 168 169 Range type 170 Invalid value 171 PASS stepUp("", null, null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 172 PASS stepDown("", null, null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 173 Non-number arguments 174 PASS stepUp("0", null, null, "0") is "0" 175 PASS stepDown("0", null, null, "0") is "0" 176 PASS stepUp("0", null, null, "foo") is "0" 177 PASS stepDown("0", null, null, "foo") is "0" 178 PASS stepUp("0", null, null, null) is "0" 179 PASS stepDown("0", null, null, null) is "0" 180 Normal cases 181 PASS stepUp("0", null, null) is "1" 182 PASS stepUp("1", null, null, 2) is "3" 183 PASS stepUp("3", null, null, -1) is "2" 184 PASS stepDown("2", null, "-100") is "1" 185 PASS stepDown("1", null, "-100", 2) is "-1" 186 PASS stepDown("-1", null, "-100", -1) is "0" 187 Extra arguments 188 PASS input.value = "0"; input.min = null; input.step = null; input.stepUp(1, 2); input.value is "1" 189 PASS input.value = "1"; input.stepDown(1, 3); input.value is "0" 190 Invalid step value 191 PASS stepUp("0", "foo", null) is "1" 192 PASS stepUp("1", "0", null) is "2" 193 PASS stepUp("2", "-1", null) is "3" 194 Step=any 195 PASS stepUp("0", "any", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 196 PASS stepDown("0", "any", null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 197 Overflow/underflow 198 PASS stepDown("1", "1", "0") is "0" 199 PASS stepDown("0", "1", "0") threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 200 PASS stepDown("1", "1", "0", 2) threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 201 PASS input.value is "1" 202 PASS stepDown("1", "1.7976931348623156e+308", "", 2) threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 203 PASS input.min = "-100"; stepUp("-1", "1", "0") is "0" 204 PASS stepUp("0", "1", "0") threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 205 PASS input.min = "-100"; stepUp("-1", "1", "0", 2) threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 206 PASS input.value is "-1" 207 PASS stepUp("1", "1.7976931348623156e+308", "", 2) threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 208 stepDown()/stepUp() for stepMismatch values 209 PASS stepUp("1", "2", "") is "4" 210 PASS input.stepDown(); input.value is "2" 211 PASS input.min = "0"; stepUp("9", "10", "", 9) is "100" 212 PASS stepDown("19", "10", "0") is "10" 213 PASS stepUp("89", "10", "99") threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 214 Huge value and small step 215 PASS input.min = "0"; stepUp("1e+308", "1", "1e+308", 999999) is "1e+308" 216 PASS input.max = "1e+308"; input.min = "0"; input.step = "1"; input.value = "1e+308"; input.stepDown(999999); input.value is "1e+308" 217 Fractional numbers 218 PASS input.min = ""; stepUp("0", "0.33333333333333333", "", 3) is "1" 219 PASS stepUp("1", "0.1", "", 10) is "2" 220 PASS input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.value is "3" 221 PASS input.min = "0"; stepUp("0", "0.003921568627450980", "1", 255) is "1" 222 PASS for (var i = 0; i < 255; i++) { input.stepDown(); }; input.value is "0" 223 114 224 Time type 115 225 Invalid value … … 167 277 PASS stepUp("2010-W02", "1", "2010-W02") threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 168 278 PASS stepDown("2010-W02", "1", "2010-W02") threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 279 280 Unsupported type 281 PASS input.step = "3"; input.min = ""; input.max = ""; input.value = "2"; input.stepDown() threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 282 PASS input.stepDown(0) threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 283 PASS input.stepUp() threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 284 PASS input.stepUp(0) threw exception Error: INVALID_STATE_ERR: DOM Exception 11. 169 285 PASS successfullyParsed is true 170 286 -
trunk/LayoutTests/fast/forms/script-tests/ValidityState-stepMismatch.js
r54647 r55423 1 1 description('Check stepMismatch results for type=date, datetime, datetime-local, month, time, week.'); 2 // FIXME: Merge other ValidityState-stepMismatch-* into this.3 2 4 3 var input = document.createElement('input'); 4 document.body.appendChild(input); 5 5 6 6 function stepMismatchFor(value, step, min) { 7 input.min = min; 8 input.step = step; 7 9 input.value = value; 8 input.step = step;9 input.min = min;10 10 return input.validity.stepMismatch; 11 11 } … … 129 129 130 130 debug(''); 131 debug('Number type'); 132 input.type = 'number'; 133 debug('Empty values'); 134 shouldBe('stepMismatchFor("", null, null)', 'false'); 135 shouldBe('stepMismatchFor("", "1.0", "0.1")', 'false'); 136 debug('Integers'); 137 shouldBe('stepMismatchFor("1", "2", "0")', 'true'); 138 shouldBe('stepMismatchFor("-3", "2", "-4")', 'true'); 139 shouldBe('input.max = "5"; stepMismatchFor("5", "3", "0")', 'true'); 140 shouldBe('input.value', '"5"'); 141 debug('Invalid step values'); 142 input.max = ''; 143 shouldBe('stepMismatchFor("-3", "-2", "-4")', 'false'); 144 shouldBe('stepMismatchFor("-3", null, "-4")', 'false'); 145 shouldBe('stepMismatchFor("-3", undefined, "-4")', 'false'); 146 debug('Huge numbers and small step; uncomparable'); 147 shouldBe('stepMismatchFor("1.7976931348623157e+308", "3", "")', 'false'); 148 shouldBe('stepMismatchFor("1.7976931348623156e+308", "3", "")', 'false'); 149 shouldBe('stepMismatchFor("1.7976931348623155e+308", "3", "")', 'false'); 150 debug('Huge numbers and huge step'); 151 shouldBe('stepMismatchFor("1.60e+308", "0.20e+308", "")', 'false'); 152 shouldBe('stepMismatchFor("1.60e+308", "0.22e+308", "")', 'true'); 153 debug('Fractional numbers'); 154 shouldBe('stepMismatchFor("0.9", "0.1", "")', 'false'); 155 shouldBe('stepMismatchFor("0.9", "0.1000001", "")', 'true'); 156 shouldBe('stepMismatchFor("0.9", "0.1000000000000001", "")', 'false'); 157 shouldBe('stepMismatchFor("1.0", "0.3333333333333333", "")', 'false'); 158 159 debug(''); 160 debug('Range type'); 161 input.type = 'range'; 162 // The following test inputs are the same as inputs for type=numbe, 163 // but all expected results should be 'false'. 164 debug('Empty values'); 165 shouldBe('stepMismatchFor("", null, null)', 'false'); 166 shouldBe('stepMismatchFor("", "1.0", "0.1")', 'false'); 167 debug('Integers'); 168 shouldBe('stepMismatchFor("1", "2", "0")', 'false'); 169 shouldBe('stepMismatchFor("-3", "2", "-4")', 'false'); 170 shouldBe('input.max = "5"; stepMismatchFor("5", "3", "0")', 'false'); 171 shouldBe('input.value', '"3"'); // Different from type=number. 172 debug('Invalid step values'); 173 input.max = ''; 174 shouldBe('stepMismatchFor("-3", "-2", "-4")', 'false'); 175 shouldBe('stepMismatchFor("-3", null, "-4")', 'false'); 176 shouldBe('stepMismatchFor("-3", undefined, "-4")', 'false'); 177 debug('Huge numbers and small step; uncomparable'); 178 shouldBe('stepMismatchFor("1.7976931348623157e+308", "3", "")', 'false'); 179 shouldBe('stepMismatchFor("1.7976931348623156e+308", "3", "")', 'false'); 180 shouldBe('stepMismatchFor("1.7976931348623155e+308", "3", "")', 'false'); 181 debug('Huge numbers and huge step'); 182 shouldBe('stepMismatchFor("1.60e+308", "0.20e+308", "")', 'false'); 183 shouldBe('stepMismatchFor("1.60e+308", "0.22e+308", "")', 'false'); 184 debug('Fractional numbers'); 185 shouldBe('stepMismatchFor("0.9", "0.1", "")', 'false'); 186 shouldBe('stepMismatchFor("0.9", "0.1000001", "")', 'false'); 187 shouldBe('stepMismatchFor("0.9", "0.1000000000000001", "")', 'false'); 188 shouldBe('stepMismatchFor("1.0", "0.3333333333333333", "")', 'false'); 189 190 debug(''); 131 191 debug('Time type'); 132 192 input.type = 'time'; … … 189 249 shouldBeFalse('stepMismatchFor("2010-W03", "any", "2010-W02")'); 190 250 251 debug(''); 252 debug('Unsupported types'); 253 shouldBe('input.type = "text"; input.step = "3"; input.min = ""; input.value = "2"; input.validity.stepMismatch', 'false'); 254 shouldBe('input.type = "button"; input.validity.stepMismatch', 'false'); 255 shouldBe('input.type = "checkbox"; input.validity.stepMismatch', 'false'); 256 shouldBe('input.type = "color"; input.validity.stepMismatch', 'false'); 257 shouldBe('input.type = "email"; input.validity.stepMismatch', 'false'); 258 shouldBe('input.type = "hidden"; input.validity.stepMismatch', 'false'); 259 shouldBe('input.type = "image"; input.validity.stepMismatch', 'false'); 260 shouldBe('input.type = "khtml_isindex"; input.validity.stepMismatch', 'false'); 261 shouldBe('input.type = "passwd"; input.validity.stepMismatch', 'false'); 262 shouldBe('input.type = "radio"; input.validity.stepMismatch', 'false'); 263 shouldBe('input.type = "reset"; input.validity.stepMismatch', 'false'); 264 shouldBe('input.type = "search"; input.validity.stepMismatch', 'false'); 265 shouldBe('input.type = "submit"; input.validity.stepMismatch', 'false'); 266 shouldBe('input.type = "tel"; input.validity.stepMismatch', 'false'); 267 shouldBe('input.type = "url"; input.validity.stepMismatch', 'false'); 268 shouldBe('input.type = "file"; input.validity.stepMismatch', 'false'); 269 191 270 var successfullyParsed = true; -
trunk/LayoutTests/fast/forms/script-tests/input-stepup-stepdown.js
r54647 r55423 1 1 description('Check stepUp() and stepDown() bahevior for type=date, datetime, datetime-local, month, time, week.'); 2 // FIXME: Merge input-step-* into this.3 2 4 3 var input = document.createElement('input'); … … 145 144 146 145 debug(''); 146 debug('Number type'); 147 input.type = 'number'; 148 debug('Invalid value'); 149 shouldThrow('stepUp("", null, null)', invalidStateErr); 150 shouldThrow('stepDown("", null, null)', invalidStateErr); 151 debug('Non-number arguments'); 152 shouldBe('stepUp("0", null, null, "0")', '"0"'); 153 shouldBe('stepDown("0", null, null, "0")', '"0"'); 154 shouldBe('stepUp("0", null, null, "foo")', '"0"'); 155 shouldBe('stepDown("0", null, null, "foo")', '"0"'); 156 shouldBe('stepUp("0", null, null, null)', '"0"'); 157 shouldBe('stepDown("0", null, null, null)', '"0"'); 158 debug('Normal cases'); 159 shouldBe('stepUp("0", null, null)', '"1"'); 160 shouldBe('stepUp("1", null, null, 2)', '"3"'); 161 shouldBe('stepUp("3", null, null, -1)', '"2"'); 162 shouldBe('stepDown("2", null, null)', '"1"'); 163 shouldBe('stepDown("1", null, null, 2)', '"-1"'); 164 shouldBe('stepDown("-1", null, null, -1)', '"0"'); 165 debug('Extra arguments'); 166 shouldBe('input.value = "0"; input.min = null; input.step = null; input.stepUp(1, 2); input.value', '"1"'); 167 shouldBe('input.value = "1"; input.stepDown(1, 3); input.value', '"0"'); 168 debug('Invalid step value'); 169 shouldBe('stepUp("0", "foo", null)', '"1"'); 170 shouldBe('stepUp("1", "0", null)', '"2"'); 171 shouldBe('stepUp("2", "-1", null)', '"3"'); 172 debug('Step=any'); 173 shouldThrow('stepUp("0", "any", null)', invalidStateErr); 174 shouldThrow('stepDown("0", "any", null)', invalidStateErr); 175 debug('Overflow/underflow'); 176 shouldBe('stepDown("1", "1", "0")', '"0"'); 177 shouldThrow('stepDown("0", "1", "0")', invalidStateErr); 178 shouldThrow('stepDown("1", "1", "0", 2)', invalidStateErr); 179 shouldBe('input.value', '"1"'); 180 shouldThrow('stepDown("1", "1.7976931348623156e+308", "", 2)', invalidStateErr); 181 shouldBe('stepUp("-1", "1", "0")', '"0"'); 182 shouldThrow('stepUp("0", "1", "0")', invalidStateErr); 183 shouldThrow('stepUp("-1", "1", "0", 2)', invalidStateErr); 184 shouldBe('input.value', '"-1"'); 185 shouldThrow('stepUp("1", "1.7976931348623156e+308", "", 2)', invalidStateErr); 186 debug('stepDown()/stepUp() for stepMismatch values'); 187 shouldBe('stepUp("1", "2", "")', '"4"'); 188 shouldBe('input.stepDown(); input.value', '"2"'); 189 shouldBe('input.min = "0"; stepUp("9", "10", "", 9)', '"100"'); 190 shouldBe('stepDown("19", "10", "0")', '"10"'); 191 // value + step is <= max, but rounded result would be > max. 192 shouldThrow('stepUp("89", "10", "99")', invalidStateErr); 193 debug('Huge value and small step'); 194 shouldBe('input.min = ""; stepUp("1e+308", "1", "", 999999)', '"1e+308"'); 195 shouldBe('input.max = ""; stepDown("1e+308", "1", "", 999999)', '"1e+308"'); 196 debug('Fractional numbers'); 197 shouldBe('input.min = ""; stepUp("0", "0.33333333333333333", "", 3)', '"1"'); 198 shouldBe('stepUp("1", "0.1", "", 10)', '"2"'); 199 shouldBe('input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.value', '"3"'); 200 shouldBe('input.min = "0"; stepUp("0", "0.003921568627450980", "1", 255)', '"1"'); 201 shouldBe('for (var i = 0; i < 255; i++) { input.stepDown(); }; input.value', '"0"'); 202 203 debug(''); 204 debug('Range type'); 205 input.type = 'range'; 206 debug('Invalid value'); 207 shouldThrow('stepUp("", null, null)', invalidStateErr); 208 shouldThrow('stepDown("", null, null)', invalidStateErr); 209 debug('Non-number arguments'); 210 shouldBe('stepUp("0", null, null, "0")', '"0"'); 211 shouldBe('stepDown("0", null, null, "0")', '"0"'); 212 shouldBe('stepUp("0", null, null, "foo")', '"0"'); 213 shouldBe('stepDown("0", null, null, "foo")', '"0"'); 214 shouldBe('stepUp("0", null, null, null)', '"0"'); 215 shouldBe('stepDown("0", null, null, null)', '"0"'); 216 debug('Normal cases'); 217 shouldBe('stepUp("0", null, null)', '"1"'); 218 shouldBe('stepUp("1", null, null, 2)', '"3"'); 219 shouldBe('stepUp("3", null, null, -1)', '"2"'); 220 shouldBe('stepDown("2", null, "-100")', '"1"'); 221 shouldBe('stepDown("1", null, "-100", 2)', '"-1"'); 222 shouldBe('stepDown("-1", null, "-100", -1)', '"0"'); 223 debug('Extra arguments'); 224 shouldBe('input.value = "0"; input.min = null; input.step = null; input.stepUp(1, 2); input.value', '"1"'); 225 shouldBe('input.value = "1"; input.stepDown(1, 3); input.value', '"0"'); 226 debug('Invalid step value'); 227 shouldBe('stepUp("0", "foo", null)', '"1"'); 228 shouldBe('stepUp("1", "0", null)', '"2"'); 229 shouldBe('stepUp("2", "-1", null)', '"3"'); 230 debug('Step=any'); 231 shouldThrow('stepUp("0", "any", null)', invalidStateErr); 232 shouldThrow('stepDown("0", "any", null)', invalidStateErr); 233 debug('Overflow/underflow'); 234 shouldBe('stepDown("1", "1", "0")', '"0"'); 235 shouldThrow('stepDown("0", "1", "0")', invalidStateErr); 236 shouldThrow('stepDown("1", "1", "0", 2)', invalidStateErr); 237 shouldBe('input.value', '"1"'); 238 shouldThrow('stepDown("1", "1.7976931348623156e+308", "", 2)', invalidStateErr); 239 shouldBe('input.min = "-100"; stepUp("-1", "1", "0")', '"0"'); 240 shouldThrow('stepUp("0", "1", "0")', invalidStateErr); 241 shouldThrow('input.min = "-100"; stepUp("-1", "1", "0", 2)', invalidStateErr); 242 shouldBe('input.value', '"-1"'); 243 shouldThrow('stepUp("1", "1.7976931348623156e+308", "", 2)', invalidStateErr); 244 debug('stepDown()/stepUp() for stepMismatch values'); 245 shouldBe('stepUp("1", "2", "")', '"4"'); 246 shouldBe('input.stepDown(); input.value', '"2"'); 247 shouldBe('input.min = "0"; stepUp("9", "10", "", 9)', '"100"'); 248 shouldBe('stepDown("19", "10", "0")', '"10"'); 249 // value + step is <= max, but rounded result would be > max. 250 shouldThrow('stepUp("89", "10", "99")', invalidStateErr); 251 debug('Huge value and small step'); 252 shouldBe('input.min = "0"; stepUp("1e+308", "1", "1e+308", 999999)', '"1e+308"'); 253 shouldBe('input.max = "1e+308"; input.min = "0"; input.step = "1"; input.value = "1e+308"; input.stepDown(999999); input.value', '"1e+308"'); 254 debug('Fractional numbers'); 255 shouldBe('input.min = ""; stepUp("0", "0.33333333333333333", "", 3)', '"1"'); 256 shouldBe('stepUp("1", "0.1", "", 10)', '"2"'); 257 shouldBe('input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.stepUp(); input.value', '"3"'); 258 shouldBe('input.min = "0"; stepUp("0", "0.003921568627450980", "1", 255)', '"1"'); 259 shouldBe('for (var i = 0; i < 255; i++) { input.stepDown(); }; input.value', '"0"'); 260 261 debug(''); 147 262 debug('Time type'); 148 263 input.type = 'time'; … … 204 319 shouldThrow('stepDown("2010-W02", "1", "2010-W02")', invalidStateErr); 205 320 321 debug(''); 322 debug('Unsupported type'); 323 shouldThrow('input.step = "3"; input.min = ""; input.max = ""; input.value = "2"; input.stepDown()', '"Error: INVALID_STATE_ERR: DOM Exception 11"'); 324 shouldThrow('input.stepDown(0)', '"Error: INVALID_STATE_ERR: DOM Exception 11"'); 325 shouldThrow('input.stepUp()', '"Error: INVALID_STATE_ERR: DOM Exception 11"'); 326 shouldThrow('input.stepUp(0)', '"Error: INVALID_STATE_ERR: DOM Exception 11"'); 327 206 328 var successfullyParsed = true;
Note: See TracChangeset
for help on using the changeset viewer.