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

Unified Diff: chrome/browser/extensions/api/permissions/permissions_api_helpers_unittest.cc

Issue 10675007: Move each permission classes to its own files in extensions/permissions (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase again Created 8 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
Index: chrome/browser/extensions/api/permissions/permissions_api_helpers_unittest.cc
diff --git a/chrome/browser/extensions/api/permissions/permissions_api_helpers_unittest.cc b/chrome/browser/extensions/api/permissions/permissions_api_helpers_unittest.cc
index 7d03989df1ccb32721f184e871b87912cc8abb66..d7606ab5461f5c6cfa61cb2944fc107637820ccb 100644
--- a/chrome/browser/extensions/api/permissions/permissions_api_helpers_unittest.cc
+++ b/chrome/browser/extensions/api/permissions/permissions_api_helpers_unittest.cc
@@ -6,7 +6,7 @@
#include "base/values.h"
#include "chrome/browser/extensions/api/permissions/permissions_api_helpers.h"
#include "chrome/common/extensions/api/permissions.h"
-#include "chrome/common/extensions/extension_permission_set.h"
+#include "chrome/common/extensions/permissions/permission_set.h"
#include "chrome/common/extensions/url_pattern_set.h"
#include "googleurl/src/gurl.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -14,6 +14,9 @@
using extensions::permissions_api_helpers::PackPermissionSet;
using extensions::permissions_api_helpers::UnpackPermissionSet;
using extensions::api::permissions::Permissions;
+using extensions::APIPermission;
+using extensions::APIPermissionSet;
+using extensions::PermissionSet;
namespace {
@@ -24,17 +27,17 @@ static void AddPattern(URLPatternSet* extent, const std::string& pattern) {
} // namespace
-// Tests that we can convert ExtensionPermissionSets to and from values.
+// Tests that we can convert PermissionSets to and from values.
TEST(ExtensionPermissionsAPIHelpers, Pack) {
- ExtensionAPIPermissionSet apis;
- apis.insert(ExtensionAPIPermission::kTab);
- apis.insert(ExtensionAPIPermission::kWebRequest);
+ APIPermissionSet apis;
+ apis.insert(APIPermission::kTab);
+ apis.insert(APIPermission::kWebRequest);
URLPatternSet hosts;
AddPattern(&hosts, "http://a.com/*");
AddPattern(&hosts, "http://b.com/*");
- scoped_refptr<ExtensionPermissionSet> permission_set =
- new ExtensionPermissionSet(apis, hosts, URLPatternSet());
+ scoped_refptr<PermissionSet> permission_set =
+ new PermissionSet(apis, hosts, URLPatternSet());
// Pack the permission set to value and verify its contents.
scoped_ptr<Permissions> permissions(PackPermissionSet(permission_set));
@@ -61,7 +64,7 @@ TEST(ExtensionPermissionsAPIHelpers, Pack) {
// Unpack the value back to a permission set and make sure its equal to the
// original one.
- scoped_refptr<ExtensionPermissionSet> from_value;
+ scoped_refptr<PermissionSet> from_value;
std::string error;
Permissions permissions_object;
EXPECT_TRUE(Permissions::Populate(*value, &permissions_object));
@@ -72,7 +75,7 @@ TEST(ExtensionPermissionsAPIHelpers, Pack) {
}
// Tests various error conditions and edge cases when unpacking values
-// into ExtensionPermissionSets.
+// into PermissionSets.
TEST(ExtensionPermissionsAPIHelpers, Unpack) {
scoped_ptr<ListValue> apis(new ListValue());
apis->Append(Value::CreateStringValue("tabs"));
@@ -80,7 +83,7 @@ TEST(ExtensionPermissionsAPIHelpers, Unpack) {
origins->Append(Value::CreateStringValue("http://a.com/*"));
scoped_ptr<DictionaryValue> value(new DictionaryValue());
- scoped_refptr<ExtensionPermissionSet> permissions;
+ scoped_refptr<PermissionSet> permissions;
std::string error;
// Origins shouldn't have to be present.
@@ -89,7 +92,7 @@ TEST(ExtensionPermissionsAPIHelpers, Unpack) {
value->Set("permissions", apis->DeepCopy());
EXPECT_TRUE(Permissions::Populate(*value, &permissions_object));
permissions = UnpackPermissionSet(permissions_object, &error);
- EXPECT_TRUE(permissions->HasAPIPermission(ExtensionAPIPermission::kTab));
+ EXPECT_TRUE(permissions->HasAPIPermission(APIPermission::kTab));
EXPECT_TRUE(permissions);
EXPECT_TRUE(error.empty());
}

Powered by Google App Engine
This is Rietveld 408576698