Chromium Code Reviews
[email protected] (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(740)

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

Issue 4687005: Track permissions granted to extensions in prefs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix mac test failure Created 10 years, 1 month 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.cc ('k') | chrome/common/extensions/extension_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/extension_manifests_unittest.cc
diff --git a/chrome/common/extensions/extension_manifests_unittest.cc b/chrome/common/extensions/extension_manifests_unittest.cc
index 3a891666537cc2a88269429db57fb0fea32272c3..446ff31bfd127703abec59ef9982279682e404cb 100644
--- a/chrome/common/extensions/extension_manifests_unittest.cc
+++ b/chrome/common/extensions/extension_manifests_unittest.cc
@@ -294,7 +294,7 @@ TEST_F(ExtensionManifestTest, OptionsPageInApps) {
errors::kInvalidOptionsPageExpectUrlInPackage);
}
-TEST_F(ExtensionManifestTest, DisallowExtensionPermissions) {
+TEST_F(ExtensionManifestTest, AllowUnrecognizedPermissions) {
std::string error;
scoped_ptr<DictionaryValue> manifest(
LoadManifestFile("valid_app.json", &error));
@@ -308,13 +308,11 @@ TEST_F(ExtensionManifestTest, DisallowExtensionPermissions) {
permissions->Clear();
permissions->Append(p);
std::string message_name = base::StringPrintf("permission-%s", name);
- if (Extension::IsHostedAppPermission(name)) {
- scoped_refptr<Extension> extension;
- extension = LoadAndExpectSuccess(manifest.get(), message_name);
- } else {
- LoadAndExpectError(manifest.get(), message_name,
- errors::kInvalidPermission);
- }
+
+ // Extensions are allowed to contain unrecognized API permissions,
+ // so there shouldn't be any errors.
+ scoped_refptr<Extension> extension;
+ extension = LoadAndExpectSuccess(manifest.get(), message_name);
}
}
« no previous file with comments | « chrome/common/extensions/extension.cc ('k') | chrome/common/extensions/extension_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698