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

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

Issue 11275088: Remove implicit scoped_refptr operator T* Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 8 years, 2 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/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 59849d6280075a50aa1770bcb4391d67b6d230e2..ce82115ddf750922398a310c2274c3af36d796f4 100644
--- a/chrome/common/extensions/permissions/permission_set_unittest.cc
+++ b/chrome/common/extensions/permissions/permission_set_unittest.cc
@@ -45,7 +45,7 @@ scoped_refptr<Extension> LoadManifest(const std::string& dir,
scoped_refptr<Extension> extension = Extension::Create(
path.DirName(), Extension::INVALID,
*static_cast<DictionaryValue*>(result.get()), extra_flags, &error);
- EXPECT_TRUE(extension) << error;
+ EXPECT_TRUE(extension.get()) << error;
return extension;
}
@@ -301,12 +301,12 @@ TEST(PermissionsTest, CreateUnion) {
set1 = new PermissionSet(apis1, explicit_hosts1, scriptable_hosts1);
set2 = new PermissionSet(apis2, explicit_hosts2, scriptable_hosts2);
union_set = PermissionSet::CreateUnion(set1.get(), set2.get());
- EXPECT_TRUE(set1->Contains(*set2));
- EXPECT_TRUE(set1->Contains(*union_set));
- EXPECT_FALSE(set2->Contains(*set1));
- EXPECT_FALSE(set2->Contains(*union_set));
- EXPECT_TRUE(union_set->Contains(*set1));
- EXPECT_TRUE(union_set->Contains(*set2));
+ EXPECT_TRUE(set1->Contains(*set2.get()));
+ EXPECT_TRUE(set1->Contains(*union_set.get()));
+ EXPECT_FALSE(set2->Contains(*set1.get()));
+ EXPECT_FALSE(set2->Contains(*union_set.get()));
+ EXPECT_TRUE(union_set->Contains(*set1.get()));
+ EXPECT_TRUE(union_set->Contains(*set2.get()));
EXPECT_FALSE(union_set->HasEffectiveFullAccess());
EXPECT_EQ(expected_apis, union_set->apis());
@@ -361,12 +361,12 @@ TEST(PermissionsTest, CreateUnion) {
set2 = new PermissionSet(apis2, explicit_hosts2, scriptable_hosts2);
union_set = PermissionSet::CreateUnion(set1.get(), set2.get());
- EXPECT_FALSE(set1->Contains(*set2));
- EXPECT_FALSE(set1->Contains(*union_set));
- EXPECT_FALSE(set2->Contains(*set1));
- EXPECT_FALSE(set2->Contains(*union_set));
- EXPECT_TRUE(union_set->Contains(*set1));
- EXPECT_TRUE(union_set->Contains(*set2));
+ EXPECT_FALSE(set1->Contains(*set2.get()));
+ EXPECT_FALSE(set1->Contains(*union_set.get()));
+ EXPECT_FALSE(set2->Contains(*set1.get()));
+ EXPECT_FALSE(set2->Contains(*union_set.get()));
+ EXPECT_TRUE(union_set->Contains(*set1.get()));
+ EXPECT_TRUE(union_set->Contains(*set2.get()));
EXPECT_TRUE(union_set->HasEffectiveFullAccess());
EXPECT_TRUE(union_set->HasEffectiveAccessToAllHosts());
@@ -421,12 +421,12 @@ TEST(PermissionsTest, CreateIntersection) {
set1 = new PermissionSet(apis1, explicit_hosts1, scriptable_hosts1);
set2 = new PermissionSet(apis2, explicit_hosts2, scriptable_hosts2);
new_set = PermissionSet::CreateIntersection(set1.get(), set2.get());
- EXPECT_TRUE(set1->Contains(*new_set));
- EXPECT_TRUE(set2->Contains(*new_set));
- EXPECT_TRUE(set1->Contains(*set2));
- EXPECT_FALSE(set2->Contains(*set1));
- EXPECT_FALSE(new_set->Contains(*set1));
- EXPECT_TRUE(new_set->Contains(*set2));
+ EXPECT_TRUE(set1->Contains(*new_set.get()));
+ EXPECT_TRUE(set2->Contains(*new_set.get()));
+ EXPECT_TRUE(set1->Contains(*set2.get()));
+ EXPECT_FALSE(set2->Contains(*set1.get()));
+ EXPECT_FALSE(new_set->Contains(*set1.get()));
+ EXPECT_TRUE(new_set->Contains(*set2.get()));
EXPECT_TRUE(new_set->IsEmpty());
EXPECT_FALSE(new_set->HasEffectiveFullAccess());
@@ -475,12 +475,12 @@ TEST(PermissionsTest, CreateIntersection) {
set2 = new PermissionSet(apis2, explicit_hosts2, scriptable_hosts2);
new_set = PermissionSet::CreateIntersection(set1.get(), set2.get());
- EXPECT_TRUE(set1->Contains(*new_set));
- EXPECT_TRUE(set2->Contains(*new_set));
- EXPECT_FALSE(set1->Contains(*set2));
- EXPECT_FALSE(set2->Contains(*set1));
- EXPECT_FALSE(new_set->Contains(*set1));
- EXPECT_FALSE(new_set->Contains(*set2));
+ EXPECT_TRUE(set1->Contains(*new_set.get()));
+ EXPECT_TRUE(set2->Contains(*new_set.get()));
+ EXPECT_FALSE(set1->Contains(*set2.get()));
+ EXPECT_FALSE(set2->Contains(*set1.get()));
+ EXPECT_FALSE(new_set->Contains(*set1.get()));
+ EXPECT_FALSE(new_set->Contains(*set2.get()));
EXPECT_FALSE(new_set->HasEffectiveFullAccess());
EXPECT_FALSE(new_set->HasEffectiveAccessToAllHosts());
@@ -535,7 +535,7 @@ TEST(PermissionsTest, CreateDifference) {
set1 = new PermissionSet(apis1, explicit_hosts1, scriptable_hosts1);
set2 = new PermissionSet(apis2, explicit_hosts2, scriptable_hosts2);
new_set = PermissionSet::CreateDifference(set1.get(), set2.get());
- EXPECT_EQ(*set1, *new_set);
+ EXPECT_EQ(*set1.get(), *new_set.get());
// Now use a real second set.
apis2.insert(APIPermission::kTab);
@@ -576,8 +576,8 @@ TEST(PermissionsTest, CreateDifference) {
set2 = new PermissionSet(apis2, explicit_hosts2, scriptable_hosts2);
new_set = PermissionSet::CreateDifference(set1.get(), set2.get());
- EXPECT_TRUE(set1->Contains(*new_set));
- EXPECT_FALSE(set2->Contains(*new_set));
+ EXPECT_TRUE(set1->Contains(*new_set.get()));
+ EXPECT_FALSE(set2->Contains(*new_set.get()));
EXPECT_FALSE(new_set->HasEffectiveFullAccess());
EXPECT_FALSE(new_set->HasEffectiveAccessToAllHosts());
@@ -638,7 +638,7 @@ TEST(PermissionsTest, HasLessPrivilegesThan) {
new_extension->GetActivePermissions());
EXPECT_EQ(kTests[i].expect_increase,
- old_p->HasLessPrivilegesThan(new_p)) << kTests[i].base_name;
+ old_p->HasLessPrivilegesThan(new_p.get())) << kTests[i].base_name;
}
}

Powered by Google App Engine
This is Rietveld 408576698