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

Unified Diff: third_party/WebKit/Source/core/html/TextControlElementTest.cpp

Issue 2533213003: [Editing] Use VisiblePosition stardOfWord for textarea in spell checker. (Closed)
Patch Set: Created 4 years, 1 month 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/Source/core/html/TextControlElementTest.cpp
diff --git a/third_party/WebKit/Source/core/html/TextControlElementTest.cpp b/third_party/WebKit/Source/core/html/TextControlElementTest.cpp
index e5d47c5b0a5527c0f4dcb44c3b801cd491da3235..2b996cb0de19414a9418a7c4d2d68c757d255428 100644
--- a/third_party/WebKit/Source/core/html/TextControlElementTest.cpp
+++ b/third_party/WebKit/Source/core/html/TextControlElementTest.cpp
@@ -210,4 +210,18 @@ TEST_F(TextControlElementTest, IndexForPosition) {
Position(innerEditor, PositionAnchorType::AfterAnchor)));
}
+TEST_F(TextControlElementTest, EnclosingTextControl) {
+ textControl().setValue("foobar");
+ EXPECT_EQ(nullptr, enclosingTextControl(Position(&document(), 0)));
+ EXPECT_EQ(nullptr, enclosingTextControl(Position(&textControl(), 0)));
+ EXPECT_EQ(&textControl(), enclosingTextControl(Position(
+ textControl().innerEditorElement(), 0)));
+ EXPECT_EQ(&textControl(),
+ enclosingTextControl(
+ Position(textControl().innerEditorElement()->firstChild(), 0)));
+ EXPECT_EQ(nullptr,
+ enclosingTextControl(Position(textControl().innerEditorElement(),
+ PositionAnchorType::BeforeAnchor)));
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698