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

Unified Diff: third_party/WebKit/Source/core/loader/BaseFetchContextTest.cpp

Issue 2823213002: Implement CanRequest in BaseFetchContext (Closed)
Patch Set: fix Created 3 years, 8 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
Index: third_party/WebKit/Source/core/loader/BaseFetchContextTest.cpp
diff --git a/third_party/WebKit/Source/core/loader/BaseFetchContextTest.cpp b/third_party/WebKit/Source/core/loader/BaseFetchContextTest.cpp
index 93b79ae7be940db3ea0fab6b8e2d8f99808d696c..bb401e145130f9d57c76a33630953356eb715433 100644
--- a/third_party/WebKit/Source/core/loader/BaseFetchContextTest.cpp
+++ b/third_party/WebKit/Source/core/loader/BaseFetchContextTest.cpp
@@ -37,11 +37,44 @@
namespace blink {
+class MockBaseFetchContext final : public BaseFetchContext {
+ public:
+ explicit MockBaseFetchContext(ExecutionContext* execution_context)
+ : BaseFetchContext(execution_context) {}
+
horo 2017/04/20 06:00:48 nit: destructor.
kinuko 2017/04/21 09:45:27 Done.
+ // BaseFetchContext overrides:
+ ContentSettingsClient* GetContentSettingsClient() const override {
+ return nullptr;
+ }
+ Settings* GetSettings() const override { return nullptr; }
+ SubresourceFilter* GetSubresourceFilter() const override { return nullptr; }
+ SecurityContext* GetMainResourceSecurityContext() const override {
+ return nullptr;
+ }
+ bool ShouldBlockRequestByInspector(const ResourceRequest&) const override {
+ return false;
+ }
+ void DispatchDidBlockRequest(const ResourceRequest&,
+ const FetchInitiatorInfo&,
+ ResourceRequestBlockedReason) const override {}
+ void ReportLocalLoadFailed(const KURL&) const override {}
+ bool ShouldBypassMainWorldCSP() const override { return false; }
+ bool IsSVGImageChromeClient() const override { return false; }
+ void CountUsage(UseCounter::Feature) const override {}
+ void CountDeprecation(UseCounter::Feature) const override {}
+ bool ShouldBlockFetchByMixedContentCheck(
+ const ResourceRequest&,
+ const KURL&,
+ SecurityViolationReportingPolicy) const override {
+ return false;
+ }
+};
+
class BaseFetchContextTest : public ::testing::Test {
protected:
void SetUp() override {
execution_context_ = new NullExecutionContext();
- fetch_context_ = new BaseFetchContext(execution_context_);
+ fetch_context_ = new MockBaseFetchContext(execution_context_);
}
Persistent<ExecutionContext> execution_context_;

Powered by Google App Engine
This is Rietveld 408576698