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

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

Issue 1167583003: Move Resource subclasses out of fetch/ (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 months 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 | « Source/core/fetch/CSSStyleSheetResource.cpp ('k') | Source/core/fetch/DEPS » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/fetch/CachingCorrectnessTest.cpp
diff --git a/Source/core/fetch/CachingCorrectnessTest.cpp b/Source/core/fetch/CachingCorrectnessTest.cpp
index c65511652f470e691d5146ac329154abfd37ea6c..93f8436475e859c4f2e33001526a47e4f194f030 100644
--- a/Source/core/fetch/CachingCorrectnessTest.cpp
+++ b/Source/core/fetch/CachingCorrectnessTest.cpp
@@ -31,7 +31,6 @@
#include "config.h"
#include "core/fetch/FetchContext.h"
-#include "core/fetch/ImageResource.h"
#include "core/fetch/MemoryCache.h"
#include "core/fetch/RawResource.h"
#include "core/fetch/Resource.h"
@@ -73,6 +72,16 @@ private:
MockFetchContext() { }
};
+class MockImageFactory : public ResourceFactory {
+public:
+ MockImageFactory() : ResourceFactory(Resource::Image) { }
+
+ Resource* create(const ResourceRequest& request, const String&) const override
+ {
+ return new Resource(request, Resource::Image);
+ }
+};
+
class CachingCorrectnessTest : public ::testing::Test {
protected:
void advanceClock(double seconds)
@@ -113,7 +122,8 @@ protected:
ResourcePtr<Resource> fetchImage()
{
FetchRequest fetchRequest(ResourceRequest(KURL(ParsedURLString, kResourceURL)), FetchInitiatorInfo());
- return ImageResource::fetch(fetchRequest, fetcher());
+ fetchRequest.mutableResourceRequest().setRequestContext(WebURLRequest::RequestContextInternal);
+ return fetcher()->requestResource(fetchRequest, MockImageFactory());
}
ResourceFetcher* fetcher() const { return m_fetcher.get(); }
« no previous file with comments | « Source/core/fetch/CSSStyleSheetResource.cpp ('k') | Source/core/fetch/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698