| Index: third_party/WebKit/Source/core/fetch/CachingCorrectnessTest.cpp
|
| diff --git a/third_party/WebKit/Source/core/fetch/CachingCorrectnessTest.cpp b/third_party/WebKit/Source/core/fetch/CachingCorrectnessTest.cpp
|
| index 99066f618a665af6d8d23ad7c97930894bb9380b..ac0c261fbb48894626035f47e8c8baa1383eddec 100644
|
| --- a/third_party/WebKit/Source/core/fetch/CachingCorrectnessTest.cpp
|
| +++ b/third_party/WebKit/Source/core/fetch/CachingCorrectnessTest.cpp
|
| @@ -38,6 +38,7 @@
|
| #include "core/fetch/ResourceFetcher.h"
|
| #include "core/fetch/ResourcePtr.h"
|
| #include "platform/network/ResourceRequest.h"
|
| +#include "platform/testing/TestingPlatformSupport.h"
|
| #include "public/platform/Platform.h"
|
| #include "testing/gtest/include/gtest/gtest.h"
|
| #include "wtf/OwnPtr.h"
|
| @@ -55,8 +56,6 @@ const double kOriginalRequestDateAsDouble = 233433000.;
|
| const char kOneDayBeforeOriginalRequest[] = "Wed, 24 May 1977 18:30:00 GMT";
|
| const char kOneDayAfterOriginalRequest[] = "Fri, 26 May 1977 18:30:00 GMT";
|
|
|
| -const unsigned char kAConstUnsignedCharZero = 0;
|
| -
|
| class MockFetchContext : public FetchContext {
|
| public:
|
| static MockFetchContext* create()
|
| @@ -120,25 +119,15 @@ protected:
|
|
|
| private:
|
| // A simple platform that mocks out the clock, for cache freshness testing.
|
| - class ProxyPlatform : public blink::Platform {
|
| + class ProxyPlatform : public TestingPlatformSupport {
|
| public:
|
| - ProxyPlatform() : m_platform(blink::Platform::current()), m_elapsedSeconds(0.) { }
|
| -
|
| - ~ProxyPlatform()
|
| - {
|
| - blink::Platform::initialize(m_platform);
|
| - }
|
| + ProxyPlatform() : m_elapsedSeconds(0.) { }
|
|
|
| void advanceClock(double seconds)
|
| {
|
| m_elapsedSeconds += seconds;
|
| }
|
|
|
| - WebThread* currentThread() override
|
| - {
|
| - return m_platform->currentThread();
|
| - }
|
| -
|
| private:
|
| // From blink::Platform:
|
| double currentTimeSeconds() override
|
| @@ -146,24 +135,11 @@ private:
|
| return kOriginalRequestDateAsDouble + m_elapsedSeconds;
|
| }
|
|
|
| - // These blink::Platform methods must be overriden to make a usable object.
|
| - virtual void cryptographicallyRandomValues(unsigned char* buffer, size_t length)
|
| - {
|
| - RELEASE_ASSERT_NOT_REACHED();
|
| - }
|
| - virtual const unsigned char* getTraceCategoryEnabledFlag(const char* categoryName)
|
| - {
|
| - return &kAConstUnsignedCharZero;
|
| - }
|
| -
|
| - blink::Platform* m_platform; // Not owned.
|
| double m_elapsedSeconds;
|
| };
|
|
|
| virtual void SetUp()
|
| {
|
| - blink::Platform::initialize(&m_proxyPlatform);
|
| -
|
| // Save the global memory cache to restore it upon teardown.
|
| m_globalMemoryCache = replaceMemoryCacheForTesting(MemoryCache::create());
|
|
|
|
|