Index: third_party/WebKit/Source/core/html/HTMLTextFormControlElementTest.cpp |
diff --git a/third_party/WebKit/Source/core/html/HTMLTextFormControlElementTest.cpp b/third_party/WebKit/Source/core/html/HTMLTextFormControlElementTest.cpp |
index 2ec394fd99798ba5c061762516569f651c4ba49d..48f07fa55773df93870a561f04d6a8a3cd3fabdf 100644 |
--- a/third_party/WebKit/Source/core/html/HTMLTextFormControlElementTest.cpp |
+++ b/third_party/WebKit/Source/core/html/HTMLTextFormControlElementTest.cpp |
@@ -215,4 +215,12 @@ TEST_F(HTMLTextFormControlElementTest, SpellCheckDoesNotCauseUpdateLayout) |
EXPECT_EQ(startCount, layoutCount()); |
} |
+TEST_F(HTMLTextFormControlElementTest, IndexForPosition) |
+{ |
+ HTMLInputElement* input = toHTMLInputElement(document().getElementById("input")); |
+ input->setValue("Hello"); |
+ HTMLElement* innerEditor = input->innerEditorElement(); |
+ EXPECT_EQ(5, HTMLTextFormControlElement::indexForPosition(innerEditor, Position(innerEditor, PositionAnchorType::AfterAnchor))); |
+} |
+ |
} // namespace blink |