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

Unified Diff: chrome/common/extensions/permissions/permission_set_unittest.cc

Issue 311113006: Collapsing the permission for "kTabs" and "kHostsAll" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed the code style nits. Created 6 years, 6 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/permissions/chrome_permission_message_provider.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/permissions/permission_set_unittest.cc
diff --git a/chrome/common/extensions/permissions/permission_set_unittest.cc b/chrome/common/extensions/permissions/permission_set_unittest.cc
index 907eb5c5c338d972d6443b1537422401242422e4..493fc0e578d053eda5c559898d7989f540c59569 100644
--- a/chrome/common/extensions/permissions/permission_set_unittest.cc
+++ b/chrome/common/extensions/permissions/permission_set_unittest.cc
@@ -864,6 +864,19 @@ TEST(PermissionsTest, SuppressedPermissionMessages) {
EXPECT_EQ(1u, messages.size());
EXPECT_EQ(PermissionMessage::kBrowsingHistory, messages[0].id());
}
+ {
+ APIPermissionSet api_permissions;
+ URLPatternSet hosts;
+ hosts.AddPattern(URLPattern(URLPattern::SCHEME_CHROMEUI, "*://*/*"));
+ api_permissions.insert(APIPermission::kTab);
+ scoped_refptr<PermissionSet> permissions(new PermissionSet(
+ api_permissions, ManifestPermissionSet(), hosts, URLPatternSet()));
+ PermissionMessages messages =
+ PermissionMessageProvider::Get()->GetPermissionMessages(
+ permissions, Manifest::TYPE_EXTENSION);
+ EXPECT_EQ(1u, messages.size());
+ EXPECT_EQ(PermissionMessage::kHostsAll, messages[0].id());
+ }
}
TEST(PermissionsTest, MergedFileSystemPermissionComparison) {
« no previous file with comments | « chrome/common/extensions/permissions/chrome_permission_message_provider.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698