| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <meta charset="utf-8"> | 4 <meta charset="utf-8"> |
| 5 <script src="../../resources/js-test.js"></script> | 5 <script src="../../resources/js-test.js"></script> |
| 6 <script src="resources/common-setrangetext.js"></script> | 6 <script src="resources/common-setrangetext.js"></script> |
| 7 </head> | 7 </head> |
| 8 <body> | 8 <body> |
| 9 <script> | 9 <script> |
| 10 description("Test setRangeText() method on common input types."); | 10 description("Test setRangeText() method on common input types."); |
| 11 | 11 |
| 12 runTestsShouldPass("input", { type: "password" }); | 12 runTestsShouldPass("input", { type: "password" }); |
| 13 runTestsShouldPass("input", { type: "tel" }); | 13 runTestsShouldPass("input", { type: "tel" }); |
| 14 runTestsShouldPass("input", { type: "text" }); | 14 runTestsShouldPass("input", { type: "text" }); |
| 15 runTestsShouldPass("input", { type: "text", dir: "rtl" }); | 15 runTestsShouldPass("input", { type: "text", dir: "rtl" }); |
| 16 runTestsShouldPass("input", { type: "url" }); | 16 runTestsShouldPass("input", { type: "url" }); |
| 17 runTestsShouldPass("input", { type: "email" }); |
| 17 | 18 |
| 18 debug("<hr>"); | 19 debug("<hr>"); |
| 19 debug("Check that setRangeText() on disconnected elements doesn't crash and has
proper values."); | 20 debug("Check that setRangeText() on disconnected elements doesn't crash and has
proper values."); |
| 20 element = document.createElement("input"); | 21 element = document.createElement("input"); |
| 21 evalAndLog("element.value = '0123456789'"); | 22 evalAndLog("element.value = '0123456789'"); |
| 22 evalAndLog("element.setRangeText('ABC', 0, 0, 'select')"); | 23 evalAndLog("element.setRangeText('ABC', 0, 0, 'select')"); |
| 23 shouldBeEqualToString("element.value", "ABC0123456789"); | 24 shouldBeEqualToString("element.value", "ABC0123456789"); |
| 24 | 25 |
| 25 runTestsShouldFail("input", { type: "button" }); | 26 runTestsShouldFail("input", { type: "button" }); |
| 26 runTestsShouldFail("input", { type: "checkbox" }); | 27 runTestsShouldFail("input", { type: "checkbox" }); |
| 27 runTestsShouldFail("input", { type: "email" }); | |
| 28 runTestsShouldFail("input", { type: "radio" }); | 28 runTestsShouldFail("input", { type: "radio" }); |
| 29 runTestsShouldFail("input", { type: "reset" }); | 29 runTestsShouldFail("input", { type: "reset" }); |
| 30 runTestsShouldFail("input", { type: "submit" }); | 30 runTestsShouldFail("input", { type: "submit" }); |
| 31 | 31 |
| 32 </script> | 32 </script> |
| 33 </body> | 33 </body> |
| 34 </html> | 34 </html> |
| OLD | NEW |