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 a3ec1cc8e5f6b46a19b817f03fc69bc4980e458e..e3e716d68154a17c953a6a5ddf46ceba47c8ca96 100644 |
--- a/third_party/WebKit/Source/web/tests/TextFinderTest.cpp |
+++ b/third_party/WebKit/Source/web/tests/TextFinderTest.cpp |
@@ -396,43 +396,30 @@ TEST_F(TextFinderTest, SequentialMatches) |
class TextFinderFakeTimerTest : public TextFinderTest { |
protected: |
- // A simple platform that mocks out the clock. |
- class TimeProxyPlatform : public TestingPlatformSupport { |
- public: |
- TimeProxyPlatform() |
- : m_timeCounter(m_oldPlatform->currentTimeSeconds()) |
- { |
- } |
- |
- private: |
- Platform& ensureFallback() |
- { |
- ASSERT(m_oldPlatform); |
- return *m_oldPlatform; |
- } |
- |
- // From blink::Platform: |
- double currentTimeSeconds() override |
- { |
- return ++m_timeCounter; |
- } |
- |
- // These two methods allow timers to work correctly. |
- double monotonicallyIncreasingTimeSeconds() override |
- { |
- return ensureFallback().monotonicallyIncreasingTimeSeconds(); |
- } |
- |
- WebUnitTestSupport* unitTestSupport() override { return ensureFallback().unitTestSupport(); } |
- WebString defaultLocale() override { return ensureFallback().defaultLocale(); } |
- WebCompositorSupport* compositorSupport() override { return ensureFallback().compositorSupport(); } |
- |
- double m_timeCounter; |
- }; |
- |
- TimeProxyPlatform m_proxyTimePlatform; |
+ void SetUp() override |
+ { |
+ s_timeElapsed = 0.0; |
+ m_originalTimeFunction = setTimeFunctionsForTesting(returnMockTime); |
+ } |
+ |
+ void TearDown() override |
+ { |
+ setTimeFunctionsForTesting(m_originalTimeFunction); |
+ } |
+ |
+private: |
+ static double returnMockTime() |
+ { |
+ s_timeElapsed += 1.0; |
+ return s_timeElapsed; |
+ } |
+ |
+ TimeFunction m_originalTimeFunction; |
+ static double s_timeElapsed; |
}; |
+double TextFinderFakeTimerTest::s_timeElapsed; |
+ |
TEST_F(TextFinderFakeTimerTest, ScopeWithTimeouts) |
{ |
// Make a long string. |