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

Unified Diff: LayoutTests/fast/forms/ValidityState-tooLong-textarea.html

Issue 435753003: Implement minlength for <input> and <textarea>. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add more layout tests Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/fast/forms/ValidityState-tooLong-textarea.html
diff --git a/LayoutTests/fast/forms/ValidityState-tooLong-textarea.html b/LayoutTests/fast/forms/ValidityState-tooLong-textarea.html
index c8cbb9c53a2ee03299fd70f46f4532726df2a1c7..280f410cb604ce292991d7e262da33e8b1af6d40 100644
--- a/LayoutTests/fast/forms/ValidityState-tooLong-textarea.html
+++ b/LayoutTests/fast/forms/ValidityState-tooLong-textarea.html
@@ -50,11 +50,19 @@ textarea.value = 'abcde';
shouldBeFalse('textarea.validity.tooLong');
debug('');
-debug('Disabled');
-textarea.disabled = true;
-shouldBeFalse('textarea.validity.tooLong');
-textarea.disabled = false;
+debug('Disabling makes the control valid');
+textarea.focus();
+textarea.setSelectionRange(5, 5); // Move the cursor at the end.
+document.execCommand('delete');
+shouldBeTrue('textarea.validity.tooLong');
+shouldBeFalse('textarea.disabled = true; textarea.validity.tooLong');
+shouldBeTrue('textarea.disabled = false; textarea.validity.tooLong');
+// TODO: The grapheme test below doesn't do its job because initial value is
+// always valid. After making a modificaton to trigger validity check, one can
+// see that the test would fail, which possibly reveals a code issue.
+// Once this is figured out, implement a similar test in
+// ValidityState-tooShort-textarea.html
debug('');
debug('Grapheme length is not greater than maxLength though character length is greater');
// fancyX should be treated as 1 grapheme.

Powered by Google App Engine
This is Rietveld 408576698