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

Unified Diff: third_party/WebKit/Source/core/fetch/CachingCorrectnessTest.cpp

Issue 2495003002: Loading: Factor out ResourceFetcherMockFetchContext (Closed)
Patch Set: enum k prefix Created 4 years, 1 month 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
« no previous file with comments | « third_party/WebKit/Source/core/BUILD.gn ('k') | third_party/WebKit/Source/core/fetch/MockFetchContext.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 edb995861fd40353b824680a504b449f3a8044cf..1dd559bfe649bae911d9d9823b518f521b9851ea 100644
--- a/third_party/WebKit/Source/core/fetch/CachingCorrectnessTest.cpp
+++ b/third_party/WebKit/Source/core/fetch/CachingCorrectnessTest.cpp
@@ -31,6 +31,7 @@
#include "core/fetch/FetchContext.h"
#include "core/fetch/ImageResource.h"
#include "core/fetch/MemoryCache.h"
+#include "core/fetch/MockFetchContext.h"
#include "core/fetch/RawResource.h"
#include "core/fetch/Resource.h"
#include "core/fetch/ResourceFetcher.h"
@@ -50,28 +51,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";
-class MockFetchContext : public FetchContext {
- public:
- static MockFetchContext* create() { return new MockFetchContext; }
-
- ~MockFetchContext() {}
-
- bool allowImage(bool imagesEnabled, const KURL&) const override {
- return true;
- }
- bool canRequest(Resource::Type,
- const ResourceRequest&,
- const KURL&,
- const ResourceLoaderOptions&,
- bool forPreload,
- FetchRequest::OriginRestriction) const override {
- return true;
- }
-
- private:
- MockFetchContext() {}
-};
-
class CachingCorrectnessTest : public ::testing::Test {
protected:
static void advanceClock(double seconds) { s_timeElapsed += seconds; }
@@ -141,7 +120,8 @@ class CachingCorrectnessTest : public ::testing::Test {
// Save the global memory cache to restore it upon teardown.
m_globalMemoryCache = replaceMemoryCacheForTesting(MemoryCache::create());
- m_fetcher = ResourceFetcher::create(MockFetchContext::create());
+ m_fetcher = ResourceFetcher::create(
+ MockFetchContext::create(MockFetchContext::kShouldNotLoadNewResource));
s_timeElapsed = 0.0;
m_originalTimeFunction = setTimeFunctionsForTesting(returnMockTime);
« no previous file with comments | « third_party/WebKit/Source/core/BUILD.gn ('k') | third_party/WebKit/Source/core/fetch/MockFetchContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698