Chromium Code Reviews| Index: LayoutTests/fast/forms/input-set-selectionStart-set-selectionEnd.html |
| diff --git a/LayoutTests/fast/forms/input-set-selectionStart-set-selectionEnd.html b/LayoutTests/fast/forms/input-set-selectionStart-set-selectionEnd.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..b5135350b0a61886891d7bf0d9412860476d633e |
| --- /dev/null |
| +++ b/LayoutTests/fast/forms/input-set-selectionStart-set-selectionEnd.html |
| @@ -0,0 +1,39 @@ |
| +<!DOCTYPE html> |
| +<html> |
| +<head> |
| +<script src="../../resources/js-test.js"></script> |
| +</head> |
| +<body> |
| +<input id="val1" type="text" /> |
| +<input id="val2" type="text" /> |
| +<script type="text/javascript"> |
| + |
|
yosin_UTC9
2014/05/09 07:12:21
nit: Please remove this extra blank line.
harpreet.sk
2014/05/14 10:24:10
Done.
|
| +description("<b>Test for BUG=367736: Blink does not respect input.selectionStart and input.selectionEnd for some cases.</b>"); |
| +var firstInput = document.getElementById('val1'); |
| +var secondInput = document.getElementById('val2'); |
| +testSelection(); |
|
yosin_UTC9
2014/05/09 07:12:21
nit: It seems we can inline |testSelection()| here
harpreet.sk
2014/05/14 10:24:10
Done.
|
| + |
| +function testSelection() |
| +{ |
| + if (!window.testRunner) { |
| + debug('This test needs window.testRunner to work.'); |
| + return; |
| + } |
| + |
| + firstInput.selectionStart = 3; |
| + firstInput.selectionEnd = 5; |
| + firstInput.value = "Parsed"; |
| + secondInput.selectionStart = 3; |
| + secondInput.selectionEnd = 5; |
| + secondInput.value = "P"; |
| + shouldBe('firstInput.selectionStart', '6'); |
| + shouldBe('firstInput.selectionEnd', '6'); |
| + shouldBe('secondInput.selectionStart', '1'); |
| + shouldBe('secondInput.selectionEnd', '1'); |
| +} |
| + |
| +</script> |
| +</head> |
|
yosin_UTC9
2014/05/09 07:12:21
nit: Please remove this extra "</head>".
harpreet.sk
2014/05/14 10:24:10
Done.
|
| + |
|
yosin_UTC9
2014/05/09 07:12:21
nit: Please remove this extra blank line.
harpreet.sk
2014/05/14 10:24:10
Done.
|
| +</body> |
| +</html> |