diff options
author | erikkay@chromium.org <erikkay@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-02 22:00:24 +0000 |
---|---|---|
committer | erikkay@chromium.org <erikkay@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-02 22:00:24 +0000 |
commit | 08483ec43f8706d39d77e6797ba8d36227ca1f06 (patch) | |
tree | 490a40d5c2e9e9ad96958160e51c78f638341b52 | |
parent | 8f168ea0f33a957a489227d30ba8c8b6e79b51f1 (diff) | |
download | chromium_src-08483ec43f8706d39d77e6797ba8d36227ca1f06.zip chromium_src-08483ec43f8706d39d77e6797ba8d36227ca1f06.tar.gz chromium_src-08483ec43f8706d39d77e6797ba8d36227ca1f06.tar.bz2 |
fix bookmark permission. update unit test to test bookmarks and history
BUG=none
TEST=ExtensionTest.IsPrivilegeIncrease
Review URL: http://codereview.chromium.org/3341007
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58411 0039d316-1c4b-4281-b951-d872f2087c98
4 files changed, 15 insertions, 1 deletions
diff --git a/chrome/common/extensions/extension.cc b/chrome/common/extensions/extension.cc index 96e024f..a8aa6d8 100644 --- a/chrome/common/extensions/extension.cc +++ b/chrome/common/extensions/extension.cc @@ -944,7 +944,6 @@ bool Extension::IsPrivilegeIncrease(Extension* old_extension, // static bool Extension::HasEffectiveBrowsingHistoryPermission() const { return HasApiPermission(kTabPermission) || - HasApiPermission(kBookmarkPermission) || HasApiPermission(kHistoryPermission); } diff --git a/chrome/common/extensions/extension_unittest.cc b/chrome/common/extensions/extension_unittest.cc index 2c0d8ca..9ea40ea 100644 --- a/chrome/common/extensions/extension_unittest.cc +++ b/chrome/common/extensions/extension_unittest.cc @@ -833,6 +833,7 @@ TEST(ExtensionTest, IsPrivilegeIncrease) { { "permissions2", true }, // tabs -> tabs,bookmarks { "permissions3", true }, // http://a -> http://a,tabs { "permissions4", false }, // plugin -> plugin,tabs + { "permissions5", true }, // bookmarks -> bookmarks,history { "plugin1", false }, // plugin -> plugin { "plugin2", false }, // plugin -> none #if defined(OS_CHROMEOS) diff --git a/chrome/test/data/extensions/allow_silent_upgrade/permissions5_new.json b/chrome/test/data/extensions/allow_silent_upgrade/permissions5_new.json new file mode 100644 index 0000000..e941633 --- /dev/null +++ b/chrome/test/data/extensions/allow_silent_upgrade/permissions5_new.json @@ -0,0 +1,7 @@ +{ + "name": "allow silent update", + "version": "1.0", + "permissions": [ + "bookmarks","history" + ] +} diff --git a/chrome/test/data/extensions/allow_silent_upgrade/permissions5_old.json b/chrome/test/data/extensions/allow_silent_upgrade/permissions5_old.json new file mode 100644 index 0000000..2e0058d --- /dev/null +++ b/chrome/test/data/extensions/allow_silent_upgrade/permissions5_old.json @@ -0,0 +1,7 @@ +{ + "name": "allow silent update", + "version": "1.0", + "permissions": [ + "bookmarks" + ] +} |