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()); |
} |
} |