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

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

Issue 1774103002: Cleanup: remove evil hack to suppress permission warnings for searchProvider (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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/permissions/chrome_permission_message_provider_unittest.cc
diff --git a/chrome/common/extensions/permissions/chrome_permission_message_provider_unittest.cc b/chrome/common/extensions/permissions/chrome_permission_message_provider_unittest.cc
index 2eab2a4df7602510846f4e1bdd41d706f1f83a12..9ff56ddd2f3f1414d599485e8fab7b955a10ccda 100644
--- a/chrome/common/extensions/permissions/chrome_permission_message_provider_unittest.cc
+++ b/chrome/common/extensions/permissions/chrome_permission_message_provider_unittest.cc
@@ -131,30 +131,4 @@ TEST_F(ChromePermissionMessageProviderUnittest,
EXPECT_FALSE(message1.submessages().empty());
}
-// Anti-test: Check that adding a parameter to a SettingsOverridePermission
-// doesn't trigger a privilege increase. This is because prior to M46 beta, we
-// failed to store the parameter in the granted_permissions pref. Now we do, and
-// we don't want to bother every user with a spurious permissions warning.
-// See crbug.com/533086.
-// TODO(treib,devlin): Remove this for M48, when hopefully all users will have
-// updated prefs.
-TEST_F(ChromePermissionMessageProviderUnittest,
- EvilHackToSuppressSettingsOverrideParameter) {
- const APIPermissionInfo* info =
- PermissionsInfo::GetInstance()->GetByID(APIPermission::kSearchProvider);
-
- APIPermissionSet granted_permissions;
- granted_permissions.insert(new SettingsOverrideAPIPermission(info));
-
- APIPermissionSet actual_permissions;
- actual_permissions.insert(new SettingsOverrideAPIPermission(info, "a.com"));
-
- EXPECT_FALSE(IsPrivilegeIncrease(granted_permissions, actual_permissions));
-
- // Just to be safe: Adding the permission (with or without parameter) should
- // still be considered a privilege escalation.
- EXPECT_TRUE(IsPrivilegeIncrease(APIPermissionSet(), granted_permissions));
- EXPECT_TRUE(IsPrivilegeIncrease(APIPermissionSet(), actual_permissions));
-}
-
} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698