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

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: Updated as per review comments 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
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 dc79c9f70374412e547454a6092adb04a728f5a3..c7d60901064d37b95840238980ca8b15d91d728e 100644
--- a/third_party/WebKit/Source/web/tests/TextFinderTest.cpp
+++ b/third_party/WebKit/Source/web/tests/TextFinderTest.cpp
@@ -433,6 +433,22 @@ protected:
TimeProxyPlatform m_proxyTimePlatform;
};
+TEST_F(TextFinderTest, WhitespaceMatches)
yosin_UTC9 2016/01/20 05:33:11 Can we put test in |TextIteratorTest| rather than
ramya.v 2016/01/20 05:59:10 Done.
+{
+ 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());
+}
+
TEST_F(TextFinderFakeTimerTest, ScopeWithTimeouts)
{
// Make a long string.

Powered by Google App Engine
This is Rietveld 408576698