| Index: third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicyTest.cpp
|
| diff --git a/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicyTest.cpp b/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicyTest.cpp
|
| index 61c2c19e24535f9b48c2a3e4717291bf9f620ce1..360a03516cb343bc519bbd3a6eb54cc1aaca94c6 100644
|
| --- a/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicyTest.cpp
|
| +++ b/third_party/WebKit/Source/core/frame/csp/ContentSecurityPolicyTest.cpp
|
| @@ -197,4 +197,17 @@ TEST_F(ContentSecurityPolicyTest, ReportURIInMeta)
|
| EXPECT_FALSE(directiveList->reportEndpoints().isEmpty());
|
| }
|
|
|
| +// Tests that object-src directives are applied to a request to load a
|
| +// plugin, but not to subresource requests that the plugin itself
|
| +// makes. https://crbug.com/603952
|
| +TEST_F(ContentSecurityPolicyTest, ObjectSrc)
|
| +{
|
| + KURL url(KURL(), "https://example.test");
|
| + csp->bindToExecutionContext(document.get());
|
| + csp->didReceiveHeader("object-src 'none';", ContentSecurityPolicyHeaderTypeEnforce, ContentSecurityPolicyHeaderSourceMeta);
|
| + EXPECT_FALSE(csp->allowRequest(WebURLRequest::RequestContextObject, url, ContentSecurityPolicy::DidNotRedirect, ContentSecurityPolicy::SuppressReport));
|
| + EXPECT_FALSE(csp->allowRequest(WebURLRequest::RequestContextEmbed, url, ContentSecurityPolicy::DidNotRedirect, ContentSecurityPolicy::SuppressReport));
|
| + EXPECT_TRUE(csp->allowRequest(WebURLRequest::RequestContextPlugin, url, ContentSecurityPolicy::DidNotRedirect, ContentSecurityPolicy::SuppressReport));
|
| +}
|
| +
|
| } // namespace blink
|
|
|