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

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

Issue 7582017: Do not display warnings for file:/// extension permissions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: feedback Created 9 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
« no previous file with comments | « chrome/common/extensions/extension_permission_set.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/extension_permission_set_unittest.cc
diff --git a/chrome/common/extensions/extension_permission_set_unittest.cc b/chrome/common/extensions/extension_permission_set_unittest.cc
index 7bba33a7e17f263283d8549bfbd8f3c35eae8900..644965f9a32cda300e61b07fc34865f536016a1c 100644
--- a/chrome/common/extensions/extension_permission_set_unittest.cc
+++ b/chrome/common/extensions/extension_permission_set_unittest.cc
@@ -872,6 +872,21 @@ TEST(ExtensionPermissionSetTest, GetDistinctHostsForDisplay) {
empty_perms, explicit_hosts, scriptable_hosts);
EXPECT_EQ(expected, perm_set->GetDistinctHostsForDisplay());
}
+
+ {
+ // We don't display warnings for file URLs because they are off by default.
+ SCOPED_TRACE("file urls");
+ explicit_hosts.ClearPatterns();
+ scriptable_hosts.ClearPatterns();
+ expected.clear();
+
+ explicit_hosts.AddPattern(
+ URLPattern(URLPattern::SCHEME_FILE, "file:///*"));
+
+ perm_set = new ExtensionPermissionSet(
+ empty_perms, explicit_hosts, scriptable_hosts);
+ EXPECT_EQ(expected, perm_set->GetDistinctHostsForDisplay());
+ }
}
TEST(ExtensionPermissionSetTest, GetDistinctHostsForDisplay_ComIsBestRcd) {
« no previous file with comments | « chrome/common/extensions/extension_permission_set.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698