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

Unified Diff: third_party/WebKit/Source/core/editing/SurroundingTextTest.cpp

Issue 2955973007: Revert of Made surrounding text work for last word in a document (Closed)
Patch Set: Created 3 years, 6 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
« no previous file with comments | « third_party/WebKit/Source/core/editing/SurroundingText.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/editing/SurroundingTextTest.cpp
diff --git a/third_party/WebKit/Source/core/editing/SurroundingTextTest.cpp b/third_party/WebKit/Source/core/editing/SurroundingTextTest.cpp
index f6d724fe1b4c4f090c69d0f23308f54438cd970f..2fe38bfe7bfe7d1d01e06cb488de5f2b789e6898 100644
--- a/third_party/WebKit/Source/core/editing/SurroundingTextTest.cpp
+++ b/third_party/WebKit/Source/core/editing/SurroundingTextTest.cpp
@@ -80,12 +80,14 @@
}
{
+ // FIXME: if the selection is at the end of the text, SurroundingText
+ // will return nothing.
VisibleSelection selection = Select(7);
SurroundingText surrounding_text(selection.Start(), 42);
- EXPECT_EQ("foo bar", surrounding_text.Content().SimplifyWhiteSpace());
- EXPECT_EQ(8u, surrounding_text.StartOffsetInContent());
- EXPECT_EQ(8u, surrounding_text.EndOffsetInContent());
+ EXPECT_EQ(0u, surrounding_text.Content().length());
+ EXPECT_EQ(0u, surrounding_text.StartOffsetInContent());
+ EXPECT_EQ(0u, surrounding_text.EndOffsetInContent());
}
{
@@ -160,17 +162,6 @@
surrounding_text.Content().SimplifyWhiteSpace());
EXPECT_EQ(7u, surrounding_text.StartOffsetInContent());
EXPECT_EQ(12u, surrounding_text.EndOffsetInContent());
- }
-
- {
- // Last word.
- VisibleSelection selection = Select(22, 26);
- SurroundingText surrounding_text(
- *CreateRange(FirstEphemeralRangeOf(selection)), 8);
-
- EXPECT_EQ("sit amet", surrounding_text.Content());
- EXPECT_EQ(4u, surrounding_text.StartOffsetInContent());
- EXPECT_EQ(8u, surrounding_text.EndOffsetInContent());
}
}
« no previous file with comments | « third_party/WebKit/Source/core/editing/SurroundingText.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698