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

Unified Diff: chrome/common/extensions/csp_validator_unittest.cc

Issue 10873060: Adding 'blob:' and 'filesystem:' URLs as secure sources for extensions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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: chrome/common/extensions/csp_validator_unittest.cc
diff --git a/chrome/common/extensions/csp_validator_unittest.cc b/chrome/common/extensions/csp_validator_unittest.cc
index 4caab6d6f3bb6329e7986dcd6698f834c432e9b9..3997ef8b73b398072512cd14a4f35c433540df23 100644
--- a/chrome/common/extensions/csp_validator_unittest.cc
+++ b/chrome/common/extensions/csp_validator_unittest.cc
@@ -91,6 +91,15 @@ TEST(ExtensionCSPValidator, IsSecure) {
"default-src 'self' http://127.0.0.1.example.com"));
EXPECT_FALSE(ContentSecurityPolicyIsSecure(
"default-src 'self' http://localhost.example.com"));
+
+ EXPECT_TRUE(ContentSecurityPolicyIsSecure(
+ "default-src 'self' blob:"));
+ EXPECT_TRUE(ContentSecurityPolicyIsSecure(
+ "default-src 'self' blob:http://example.com/XXX"));
abarth-chromium 2012/08/24 14:55:00 I would EXPECT_FALSE here. You can't load cross-o
Mike West 2012/08/24 15:13:36 I can certainly change it to only accept the proto
+ EXPECT_TRUE(ContentSecurityPolicyIsSecure(
+ "default-src 'self' filesystem:"));
+ EXPECT_TRUE(ContentSecurityPolicyIsSecure(
+ "default-src 'self' filesystem:http://example.com/XXX"));
abarth-chromium 2012/08/24 14:55:00 Same for filesystem.
}
TEST(ExtensionCSPValidator, IsSandboxed) {
« chrome/common/extensions/csp_validator.cc ('K') | « chrome/common/extensions/csp_validator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698