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

Unified Diff: third_party/WebKit/Source/web/tests/TextFinderTest.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: Adding testcase Created 5 years 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/web/tests/TextFinderTest.cpp
diff --git a/third_party/WebKit/Source/web/tests/TextFinderTest.cpp b/third_party/WebKit/Source/web/tests/TextFinderTest.cpp
index d3260d19e37f143f946b6370df91390d8bf65cb5..38aad02cbbe5b1931b22f70fd0026835084b83e0 100644
--- a/third_party/WebKit/Source/web/tests/TextFinderTest.cpp
+++ b/third_party/WebKit/Source/web/tests/TextFinderTest.cpp
@@ -395,6 +395,22 @@ TEST_F(TextFinderTest, SequentialMatches)
EXPECT_EQ(findInPageRect(textNode, 4, textNode, 6), matchRects[2]);
}
+TEST_F(TextFinderTest, WhitespaceMatches)
+{
+ document().body()->setInnerHTML("<span>Some text </span> <input type='button' value='Button text'/><span>Some more text</span>", ASSERT_NO_EXCEPTION);
+
+ int identifier = 0;
+ WebString searchText(String(" "));
+ WebFindOptions findOptions; // Default.
+
+ textFinder().resetMatchCount();
+ textFinder().scopeStringMatches(identifier, searchText, findOptions, true);
+ while (textFinder().scopingInProgress())
+ runPendingTasks();
+
+ EXPECT_EQ(5, textFinder().totalMatchCount());
+}
+
class TextFinderFakeTimerTest : public TextFinderTest {
protected:
// A simple platform that mocks out the clock.
« third_party/WebKit/Source/web/TextFinder.cpp ('K') | « third_party/WebKit/Source/web/TextFinder.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698