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..7c2152b686cdf06a2421def0099fa954d2b059dd |
--- /dev/null |
+++ b/LayoutTests/fast/forms/input-set-selectionStart-set-selectionEnd.html |
@@ -0,0 +1,29 @@ |
+<!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"> |
+description("<b>Test for BUG=367736: Blink does not respect input.selectionStart and input.selectionEnd for some cases.</b>"); |
tkent
2014/05/19 00:00:34
<b> tags are unnecessary.
Also, double-quotes are
harpreet.sk
2014/05/19 11:16:52
Done.
|
+var firstInput = document.getElementById('val1'); |
+var secondInput = document.getElementById('val2'); |
+if (!window.testRunner) { |
+ debug('This test needs window.testRunner to work.'); |
+} else { |
+ firstInput.selectionStart = 3; |
+ firstInput.selectionEnd = 5; |
+ firstInput.value = "Parsed"; |
+ secondInput.selectionStart = 3; |
+ secondInput.selectionEnd = 5; |
+ secondInput.value = "P"; |
+ shouldBe('firstInput.selectionStart', '6'); |
tkent
2014/05/19 00:00:34
Why is it 6? firstInput doesn't have focus, so se
harpreet.sk
2014/05/19 11:16:52
I checked this case on the browser and it was show
|
+ shouldBe('firstInput.selectionEnd', '6'); |
+ shouldBe('secondInput.selectionStart', '1'); |
+ shouldBe('secondInput.selectionEnd', '1'); |
+} |
tkent
2014/05/19 00:00:34
We should have another scenario that secondInput.v
harpreet.sk
2014/05/19 11:16:52
Done.
|
+</script> |
+</body> |
+</html> |