| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 explicit MockBaseFetchContext(ExecutionContext* execution_context) | 42 explicit MockBaseFetchContext(ExecutionContext* execution_context) |
| 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* GetMainResourceSecurityContext() const override { | 52 SecurityContext* GetParentSecurityContext() const override { return nullptr; } |
| 53 return nullptr; | |
| 54 } | |
| 55 bool ShouldBlockRequestByInspector(const ResourceRequest&) const override { | 53 bool ShouldBlockRequestByInspector(const ResourceRequest&) const override { |
| 56 return false; | 54 return false; |
| 57 } | 55 } |
| 58 void DispatchDidBlockRequest(const ResourceRequest&, | 56 void DispatchDidBlockRequest(const ResourceRequest&, |
| 59 const FetchInitiatorInfo&, | 57 const FetchInitiatorInfo&, |
| 60 ResourceRequestBlockedReason) const override {} | 58 ResourceRequestBlockedReason) const override {} |
| 61 void ReportLocalLoadFailed(const KURL&) const override {} | 59 void ReportLocalLoadFailed(const KURL&) const override {} |
| 62 bool ShouldBypassMainWorldCSP() const override { return false; } | 60 bool ShouldBypassMainWorldCSP() const override { return false; } |
| 63 bool IsSVGImageChromeClient() const override { return false; } | 61 bool IsSVGImageChromeClient() const override { return false; } |
| 64 void CountUsage(UseCounter::Feature) const override {} | 62 void CountUsage(UseCounter::Feature) const override {} |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 KURL url(KURL(), "http://baz.test"); | 253 KURL url(KURL(), "http://baz.test"); |
| 256 ResourceRequest resource_request(url); | 254 ResourceRequest resource_request(url); |
| 257 resource_request.SetRequestContext(WebURLRequest::kRequestContextScript); | 255 resource_request.SetRequestContext(WebURLRequest::kRequestContextScript); |
| 258 EXPECT_EQ(ResourceRequestBlockedReason::CSP, | 256 EXPECT_EQ(ResourceRequestBlockedReason::CSP, |
| 259 fetch_context_->AllowResponse(Resource::kScript, resource_request, | 257 fetch_context_->AllowResponse(Resource::kScript, resource_request, |
| 260 url, ResourceLoaderOptions())); | 258 url, ResourceLoaderOptions())); |
| 261 EXPECT_EQ(2u, policy->violation_reports_sent_.size()); | 259 EXPECT_EQ(2u, policy->violation_reports_sent_.size()); |
| 262 } | 260 } |
| 263 | 261 |
| 264 } // namespace blink | 262 } // namespace blink |
| OLD | NEW |