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

Unified Diff: third_party/WebKit/LayoutTests/imported/wpt/html/semantics/forms/textfieldselection/textfieldselection-setSelectionRange.html

Issue 2143653006: Import wpt@c875b4212a473363afe8c09f012edf201386cb5b (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update W3CImportExpectations Created 4 years, 5 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: third_party/WebKit/LayoutTests/imported/wpt/html/semantics/forms/textfieldselection/textfieldselection-setSelectionRange.html
diff --git a/third_party/WebKit/LayoutTests/imported/wpt/html/semantics/forms/textfieldselection/textfieldselection-setSelectionRange.html b/third_party/WebKit/LayoutTests/imported/wpt/html/semantics/forms/textfieldselection/textfieldselection-setSelectionRange.html
index 5f525736201fcbc7210561d913a954df231c50ed..60d591bafab22b14925a52a252df345bdc563a9d 100644
--- a/third_party/WebKit/LayoutTests/imported/wpt/html/semantics/forms/textfieldselection/textfieldselection-setSelectionRange.html
+++ b/third_party/WebKit/LayoutTests/imported/wpt/html/semantics/forms/textfieldselection/textfieldselection-setSelectionRange.html
@@ -32,6 +32,18 @@ test(function() {
},'input setSelectionRange(0,input.value.length+1)');
test(function() {
+ input.setSelectionRange(input.value.length+1,input.value.length+1)
+ assert_equals(input.selectionStart, input.value.length, "Arguments (start) greater than the length of the value of the text field must be treated as pointing at the end of the text field");
+ assert_equals(input.selectionEnd, input.value.length, "Arguments (end) greater than the length of the value of the text field must be treated as pointing at the end of the text field");
+ },'input setSelectionRange(input.value.length+1,input.value.length+1)');
+
+ test(function() {
+ input.setSelectionRange(input.value.length+1,1)
+ assert_equals(input.selectionStart, 1, "If end is less than or equal to start then the start of the selection and the end of the selection must both be placed immediately before the character with offset end");
+ assert_equals(input.selectionEnd, 1, "element.selectionEnd should be 1");
+ },'input setSelectionRange(input.value.length+1,input.value.length+1)');
+
+ test(function() {
input.setSelectionRange(2,2)
assert_equals(input.selectionStart, 2, "If end is less than or equal to start then the start of the selection and the end of the selection must both be placed immediately before the character with offset end");
assert_equals(input.selectionEnd, 2, "If end is less than or equal to start then the start of the selection and the end of the selection must both be placed immediately before the character with offset end");
@@ -74,6 +86,18 @@ test(function() {
},'input direction of setSelectionRange(0,1)');
test(function() {
+ input.setSelectionRange(1,-1);
+ assert_equals(input.selectionStart, 1, "element.selectionStart should be 1");
+ assert_equals(input.selectionEnd, input.value.length, "ECMAScript conversion to unsigned long");
+ },'input setSelectionRange(1,-1)');
+
+ test(function() {
+ input.setSelectionRange(-1,1);
+ assert_equals(input.selectionStart, 1, "ECMAScript conversion to unsigned long + if end is less than or equal to start then the start of the selection and the end of the selection must both be placed immediately before the character with offset end");
+ assert_equals(input.selectionEnd, 1, "element.selectionEnd should be 1");
+ },'input setSelectionRange(-1,1)');
+
+ test(function() {
input.setSelectionRange("string",1);
assert_equals(input.selectionStart, 0, "element.selectionStart should be 0");
assert_equals(input.selectionEnd, 1, "element.selectionEnd should be 1");

Powered by Google App Engine
This is Rietveld 408576698