| Index: Source/web/tests/TextFinderTest.cpp
|
| diff --git a/Source/web/tests/TextFinderTest.cpp b/Source/web/tests/TextFinderTest.cpp
|
| index 1b2a7c57603e2657d82afc714d5532c547d19bbb..524929401eef5c8aa27e08d7eb69bbb6cdb6efd9 100644
|
| --- a/Source/web/tests/TextFinderTest.cpp
|
| +++ b/Source/web/tests/TextFinderTest.cpp
|
| @@ -12,6 +12,7 @@
|
| #include "core/dom/Range.h"
|
| #include "core/dom/shadow/ShadowRoot.h"
|
| #include "core/html/HTMLElement.h"
|
| +#include "core/testing/UnitTestHelpers.h"
|
| #include "public/platform/Platform.h"
|
| #include "public/web/WebDocument.h"
|
| #include "web/FindInPageCoordinates.h"
|
| @@ -21,6 +22,7 @@
|
| #include <gtest/gtest.h>
|
|
|
| using namespace blink;
|
| +using blink::testing::runPendingTasks;
|
|
|
| namespace {
|
|
|
| @@ -250,7 +252,7 @@ TEST_F(TextFinderTest, ScopeTextMatchesSimple)
|
| textFinder().resetMatchCount();
|
| textFinder().scopeStringMatches(identifier, searchText, findOptions, true);
|
| while (textFinder().scopingInProgress())
|
| - FrameTestHelpers::runPendingTasks();
|
| + runPendingTasks();
|
|
|
| EXPECT_EQ(2, textFinder().totalMatchCount());
|
| WebVector<WebFloatRect> matchRects;
|
| @@ -276,7 +278,7 @@ TEST_F(TextFinderTest, ScopeTextMatchesWithShadowDOM)
|
| textFinder().resetMatchCount();
|
| textFinder().scopeStringMatches(identifier, searchText, findOptions, true);
|
| while (textFinder().scopingInProgress())
|
| - FrameTestHelpers::runPendingTasks();
|
| + runPendingTasks();
|
|
|
| // TextIterator currently returns the matches in the document order, instead of the visual order. It visits
|
| // the shadow roots first, so in this case the matches will be returned in the order of <u> -> <b> -> <i>.
|
| @@ -301,7 +303,7 @@ TEST_F(TextFinderTest, ScopeRepeatPatternTextMatches)
|
| textFinder().resetMatchCount();
|
| textFinder().scopeStringMatches(identifier, searchText, findOptions, true);
|
| while (textFinder().scopingInProgress())
|
| - FrameTestHelpers::runPendingTasks();
|
| + runPendingTasks();
|
|
|
| EXPECT_EQ(2, textFinder().totalMatchCount());
|
| WebVector<WebFloatRect> matchRects;
|
| @@ -323,7 +325,7 @@ TEST_F(TextFinderTest, OverlappingMatches)
|
| textFinder().resetMatchCount();
|
| textFinder().scopeStringMatches(identifier, searchText, findOptions, true);
|
| while (textFinder().scopingInProgress())
|
| - FrameTestHelpers::runPendingTasks();
|
| + runPendingTasks();
|
|
|
| // We shouldn't find overlapped matches.
|
| EXPECT_EQ(1, textFinder().totalMatchCount());
|
| @@ -345,7 +347,7 @@ TEST_F(TextFinderTest, SequentialMatches)
|
| textFinder().resetMatchCount();
|
| textFinder().scopeStringMatches(identifier, searchText, findOptions, true);
|
| while (textFinder().scopingInProgress())
|
| - FrameTestHelpers::runPendingTasks();
|
| + runPendingTasks();
|
|
|
| EXPECT_EQ(3, textFinder().totalMatchCount());
|
| WebVector<WebFloatRect> matchRects;
|
| @@ -470,7 +472,7 @@ TEST_F(TextFinderFakeTimerTest, ScopeWithTimeouts)
|
| // of the TimeProxyPlatform timer is greater than timeout threshold.
|
| textFinder().scopeStringMatches(identifier, searchPattern, findOptions, true);
|
| while (textFinder().scopingInProgress())
|
| - FrameTestHelpers::runPendingTasks();
|
| + runPendingTasks();
|
|
|
| EXPECT_EQ(4, textFinder().totalMatchCount());
|
| }
|
|
|