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

Unified Diff: third_party/WebKit/Source/core/fetch/MockFetchContext.h

Issue 2644083003: ResourceFetcherTest: introduce FetchTestingPlatformSupport (Closed)
Patch Set: Created 3 years, 11 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 | « no previous file | third_party/WebKit/Source/core/fetch/ResourceFetcherTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/fetch/MockFetchContext.h
diff --git a/third_party/WebKit/Source/core/fetch/MockFetchContext.h b/third_party/WebKit/Source/core/fetch/MockFetchContext.h
index 01e52d09c56ea6ad670f9aa6ccaa1a3390088bf8..e7dc39f6df5081c76354bd0abff0c31f8534b5a6 100644
--- a/third_party/WebKit/Source/core/fetch/MockFetchContext.h
+++ b/third_party/WebKit/Source/core/fetch/MockFetchContext.h
@@ -35,6 +35,12 @@ class MockFetchContext : public FetchContext {
~MockFetchContext() override {}
+ void setCachePolicy(CachePolicy policy) { m_policy = policy; }
+ void setLoadComplete(bool complete) { m_complete = complete; }
+ long long getTransferSize() const { return m_transferSize; }
+ void runLoadingTaskRunnerUntilIdle() { m_runner->runUntilIdle(); }
+
+ // FetchContext:
bool allowImage(bool imagesEnabled, const KURL&) const override {
return true;
}
@@ -51,17 +57,12 @@ class MockFetchContext : public FetchContext {
return m_loadPolicy == kShouldLoadNewResource;
}
RefPtr<WebTaskRunner> loadingTaskRunner() const override { return m_runner; }
kinuko 2017/01/19 18:40:18 Could you help me understand... so the task runner
Takashi Toyoshima 2017/01/20 04:13:16 The right approach to obtain the task runner in fe
kinuko 2017/01/20 05:00:33 When you say MemoryCache do you mean the task obse
-
- void setCachePolicy(CachePolicy policy) { m_policy = policy; }
CachePolicy getCachePolicy() const override { return m_policy; }
- void setLoadComplete(bool complete) { m_complete = complete; }
bool isLoadComplete() const override { return m_complete; }
-
void addResourceTiming(
const ResourceTimingInfo& resourceTimingInfo) override {
m_transferSize = resourceTimingInfo.transferSize();
}
- long long getTransferSize() const { return m_transferSize; }
private:
MockFetchContext(LoadPolicy loadPolicy)
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/fetch/ResourceFetcherTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698