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

Unified Diff: Source/core/frame/csp/ContentSecurityPolicyTest.cpp

Issue 1326823003: CSP: 'frame-ancestors' should override 'x-frame-options'. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 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: Source/core/frame/csp/ContentSecurityPolicyTest.cpp
diff --git a/Source/core/frame/csp/ContentSecurityPolicyTest.cpp b/Source/core/frame/csp/ContentSecurityPolicyTest.cpp
index 46f1b60a1a799a6c656eb17bdb7ca30df8ab3082..ab4974b4adfa5ca6bed7c9d682535beaf637354d 100644
--- a/Source/core/frame/csp/ContentSecurityPolicyTest.cpp
+++ b/Source/core/frame/csp/ContentSecurityPolicyTest.cpp
@@ -92,4 +92,16 @@ TEST_F(ContentSecurityPolicyTest, CopyPluginTypesFrom)
EXPECT_FALSE(csp2->allowPluginType("application/x-type-2", "application/x-type-2", exampleUrl, ContentSecurityPolicy::SuppressReport));
}
+TEST_F(ContentSecurityPolicyTest, IsFrameAncestorsEnforced)
+{
+ csp->didReceiveHeader("script-src 'none';", ContentSecurityPolicyHeaderTypeEnforce, ContentSecurityPolicyHeaderSourceHTTP);
+ EXPECT_FALSE(csp->isFrameAncestorsEnforced());
+
+ csp->didReceiveHeader("frame-ancestors 'self'", ContentSecurityPolicyHeaderTypeReport, ContentSecurityPolicyHeaderSourceHTTP);
+ EXPECT_FALSE(csp->isFrameAncestorsEnforced());
+
+ csp->didReceiveHeader("frame-ancestors 'self'", ContentSecurityPolicyHeaderTypeEnforce, ContentSecurityPolicyHeaderSourceHTTP);
+ EXPECT_TRUE(csp->isFrameAncestorsEnforced());
+}
+
} // namespace

Powered by Google App Engine
This is Rietveld 408576698