| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (c) 2015, Google Inc. All rights reserved. | 2 * Copyright (c) 2015, Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 : BaseFetchContext(execution_context) {} | 43 : BaseFetchContext(execution_context) {} |
| 44 ~MockBaseFetchContext() override {} | 44 ~MockBaseFetchContext() override {} |
| 45 | 45 |
| 46 // BaseFetchContext overrides: | 46 // BaseFetchContext overrides: |
| 47 ContentSettingsClient* GetContentSettingsClient() const override { | 47 ContentSettingsClient* GetContentSettingsClient() const override { |
| 48 return nullptr; | 48 return nullptr; |
| 49 } | 49 } |
| 50 Settings* GetSettings() const override { return nullptr; } | 50 Settings* GetSettings() const override { return nullptr; } |
| 51 SubresourceFilter* GetSubresourceFilter() const override { return nullptr; } | 51 SubresourceFilter* GetSubresourceFilter() const override { return nullptr; } |
| 52 SecurityContext* GetParentSecurityContext() const override { return nullptr; } | 52 SecurityContext* GetParentSecurityContext() const override { return nullptr; } |
| 53 bool ShouldBlockRequestByInspector(const ResourceRequest&) const override { | |
| 54 return false; | |
| 55 } | |
| 56 void DispatchDidBlockRequest(const ResourceRequest&, | 53 void DispatchDidBlockRequest(const ResourceRequest&, |
| 57 const FetchInitiatorInfo&, | 54 const FetchInitiatorInfo&, |
| 58 ResourceRequestBlockedReason) const override {} | 55 ResourceRequestBlockedReason) const override {} |
| 59 void ReportLocalLoadFailed(const KURL&) const override {} | 56 void ReportLocalLoadFailed(const KURL&) const override {} |
| 60 bool ShouldBypassMainWorldCSP() const override { return false; } | 57 bool ShouldBypassMainWorldCSP() const override { return false; } |
| 61 bool IsSVGImageChromeClient() const override { return false; } | 58 bool IsSVGImageChromeClient() const override { return false; } |
| 62 void CountUsage(UseCounter::Feature) const override {} | 59 void CountUsage(UseCounter::Feature) const override {} |
| 63 void CountDeprecation(UseCounter::Feature) const override {} | 60 void CountDeprecation(UseCounter::Feature) const override {} |
| 64 bool ShouldBlockFetchByMixedContentCheck( | 61 bool ShouldBlockFetchByMixedContentCheck( |
| 65 const ResourceRequest&, | 62 const ResourceRequest&, |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 KURL url(KURL(), "http://baz.test"); | 250 KURL url(KURL(), "http://baz.test"); |
| 254 ResourceRequest resource_request(url); | 251 ResourceRequest resource_request(url); |
| 255 resource_request.SetRequestContext(WebURLRequest::kRequestContextScript); | 252 resource_request.SetRequestContext(WebURLRequest::kRequestContextScript); |
| 256 EXPECT_EQ(ResourceRequestBlockedReason::CSP, | 253 EXPECT_EQ(ResourceRequestBlockedReason::CSP, |
| 257 fetch_context_->AllowResponse(Resource::kScript, resource_request, | 254 fetch_context_->AllowResponse(Resource::kScript, resource_request, |
| 258 url, ResourceLoaderOptions())); | 255 url, ResourceLoaderOptions())); |
| 259 EXPECT_EQ(2u, policy->violation_reports_sent_.size()); | 256 EXPECT_EQ(2u, policy->violation_reports_sent_.size()); |
| 260 } | 257 } |
| 261 | 258 |
| 262 } // namespace blink | 259 } // namespace blink |
| OLD | NEW |