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

Unified Diff: third_party/WebKit/Source/core/editing/iterators/TextIteratorTest.cpp

Issue 1483013003: Find In Page doesn't work properly when " " is searched (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebasing the patch Created 4 years, 11 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/iterators/TextIteratorFlags.h ('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/iterators/TextIteratorTest.cpp
diff --git a/third_party/WebKit/Source/core/editing/iterators/TextIteratorTest.cpp b/third_party/WebKit/Source/core/editing/iterators/TextIteratorTest.cpp
index f94369479acf5e4698f1186d5b5d2e5604275f1c..4a1890b1188d3e753c65b26781d70c271cfee20a 100644
--- a/third_party/WebKit/Source/core/editing/iterators/TextIteratorTest.cpp
+++ b/third_party/WebKit/Source/core/editing/iterators/TextIteratorTest.cpp
@@ -386,6 +386,14 @@ TEST_F(TextIteratorTest, RangeLengthWithReplacedElements)
EXPECT_EQ(3, TextIterator::rangeLength(range->startPosition(), range->endPosition()));
}
+TEST_F(TextIteratorTest, WhitespaceCollapseForReplacedElements)
+{
+ static const char* bodyContent = "<span>Some text </span> <input type='button' value='Button text'/><span>Some more text</span>";
+ setBodyContent(bodyContent);
+ EXPECT_EQ("[Some text ][][Some more text]", iterate<DOMTree>(TextIteratorCollapseTrailingSpace));
+ EXPECT_EQ("[Some text ][][Button text][Some more text]", iterate<ComposedTree>(TextIteratorCollapseTrailingSpace));
+}
+
TEST_F(TextIteratorTest, copyTextTo)
{
const char* bodyContent = "<a id=host><b id=one>one</b> not appeared <b id=two>two</b></a>";
« no previous file with comments | « third_party/WebKit/Source/core/editing/iterators/TextIteratorFlags.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698