| Index: Source/web/tests/TextFinderTest.cpp
|
| diff --git a/Source/web/tests/TextFinderTest.cpp b/Source/web/tests/TextFinderTest.cpp
|
| index 505b3e3b243d46bcce28aa5493f6b157e4836ef2..d5219ebd4baf6c486296f4f9d9802dd800a72b50 100644
|
| --- a/Source/web/tests/TextFinderTest.cpp
|
| +++ b/Source/web/tests/TextFinderTest.cpp
|
| @@ -289,4 +289,26 @@ TEST_F(TextFinderTest, ScopeTextMatchesWithShadowDOM)
|
| EXPECT_EQ(findInPageRect(textInIElement, 0, textInIElement, 3), matchRects[2]);
|
| }
|
|
|
| +TEST_F(TextFinderTest, ScopeRepeatPatternTextMatches)
|
| +{
|
| + document().body()->setInnerHTML("ab ab ab ab ab", ASSERT_NO_EXCEPTION);
|
| + Node* textNode = document().body()->firstChild();
|
| +
|
| + int identifier = 0;
|
| + WebString searchText(String("ab ab"));
|
| + WebFindOptions findOptions; // Default.
|
| +
|
| + textFinder().resetMatchCount();
|
| + textFinder().scopeStringMatches(identifier, searchText, findOptions, true);
|
| + while (textFinder().scopingInProgress())
|
| + FrameTestHelpers::runPendingTasks();
|
| +
|
| + EXPECT_EQ(2, textFinder().totalMatchCount());
|
| + WebVector<WebFloatRect> matchRects;
|
| + textFinder().findMatchRects(matchRects);
|
| + ASSERT_EQ(2u, matchRects.size());
|
| + EXPECT_EQ(findInPageRect(textNode, 0, textNode, 5), matchRects[0]);
|
| + EXPECT_EQ(findInPageRect(textNode, 6, textNode, 11), matchRects[1]);
|
| +}
|
| +
|
| } // namespace
|
|
|