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

Unified Diff: chrome/browser/extensions/extension_special_storage_policy_unittest.cc

Issue 16295003: Update chrome/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 7 years, 7 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/extension_special_storage_policy_unittest.cc
diff --git a/chrome/browser/extensions/extension_special_storage_policy_unittest.cc b/chrome/browser/extensions/extension_special_storage_policy_unittest.cc
index 942732c649d59ee3f3553648846cd0c5e0ac050f..8e7ae0c920b5666220427198a5baa3d25260f25b 100644
--- a/chrome/browser/extensions/extension_special_storage_policy_unittest.cc
+++ b/chrome/browser/extensions/extension_special_storage_policy_unittest.cc
@@ -196,7 +196,7 @@ TEST_F(ExtensionSpecialStoragePolicyTest, EmptyPolicy) {
TEST_F(ExtensionSpecialStoragePolicyTest, AppWithProtectedStorage) {
scoped_refptr<Extension> extension(CreateProtectedApp());
- policy_->GrantRightsForExtension(extension);
+ policy_->GrantRightsForExtension(extension.get());
ExtensionSet protecting_extensions;
protecting_extensions.Insert(extension);
ExtensionSet empty_set;
@@ -209,7 +209,7 @@ TEST_F(ExtensionSpecialStoragePolicyTest, AppWithProtectedStorage) {
ExpectProtectedBy(protecting_extensions, GURL("https://bar.wildcards/"));
ExpectProtectedBy(empty_set, GURL("http://not_listed/"));
- policy_->RevokeRightsForExtension(extension);
+ policy_->RevokeRightsForExtension(extension.get());
ExpectProtectedBy(empty_set, GURL("http://explicit/"));
ExpectProtectedBy(empty_set, GURL("http://foo.wildcards/"));
ExpectProtectedBy(empty_set, GURL("https://bar.wildcards/"));
@@ -217,7 +217,7 @@ TEST_F(ExtensionSpecialStoragePolicyTest, AppWithProtectedStorage) {
TEST_F(ExtensionSpecialStoragePolicyTest, AppWithUnlimitedStorage) {
scoped_refptr<Extension> extension(CreateUnlimitedApp());
- policy_->GrantRightsForExtension(extension);
+ policy_->GrantRightsForExtension(extension.get());
ExtensionSet protecting_extensions;
protecting_extensions.Insert(extension);
ExtensionSet empty_set;
@@ -235,7 +235,7 @@ TEST_F(ExtensionSpecialStoragePolicyTest, AppWithUnlimitedStorage) {
EXPECT_TRUE(policy_->IsStorageUnlimited(GURL("https://bar.wildcards/")));
EXPECT_FALSE(policy_->IsStorageUnlimited(GURL("http://not_listed/")));
- policy_->RevokeRightsForExtension(extension);
+ policy_->RevokeRightsForExtension(extension.get());
ExpectProtectedBy(empty_set, GURL("http://explicit/"));
ExpectProtectedBy(empty_set, GURL("https://foo.wildcards/"));
ExpectProtectedBy(empty_set, GURL("https://foo.wildcards/"));
@@ -251,9 +251,9 @@ TEST_F(ExtensionSpecialStoragePolicyTest, CanQueryDiskSize) {
scoped_refptr<Extension> regular_app(CreateRegularApp());
scoped_refptr<Extension> protected_app(CreateProtectedApp());
scoped_refptr<Extension> unlimited_app(CreateUnlimitedApp());
- policy_->GrantRightsForExtension(regular_app);
- policy_->GrantRightsForExtension(protected_app);
- policy_->GrantRightsForExtension(unlimited_app);
+ policy_->GrantRightsForExtension(regular_app.get());
+ policy_->GrantRightsForExtension(protected_app.get());
+ policy_->GrantRightsForExtension(unlimited_app.get());
EXPECT_FALSE(policy_->CanQueryDiskSize(kHttpUrl));
EXPECT_FALSE(policy_->CanQueryDiskSize(kExtensionUrl));
@@ -266,7 +266,7 @@ TEST_F(ExtensionSpecialStoragePolicyTest, HasIsolatedStorage) {
const GURL kHttpUrl("http://foo");
const GURL kExtensionUrl("chrome-extension://bar");
scoped_refptr<Extension> app(CreateRegularApp());
- policy_->GrantRightsForExtension(app);
+ policy_->GrantRightsForExtension(app.get());
EXPECT_FALSE(policy_->HasIsolatedStorage(kHttpUrl));
EXPECT_FALSE(policy_->HasIsolatedStorage(kExtensionUrl));
@@ -276,8 +276,8 @@ TEST_F(ExtensionSpecialStoragePolicyTest, HasIsolatedStorage) {
TEST_F(ExtensionSpecialStoragePolicyTest, OverlappingApps) {
scoped_refptr<Extension> protected_app(CreateProtectedApp());
scoped_refptr<Extension> unlimited_app(CreateUnlimitedApp());
- policy_->GrantRightsForExtension(protected_app);
- policy_->GrantRightsForExtension(unlimited_app);
+ policy_->GrantRightsForExtension(protected_app.get());
+ policy_->GrantRightsForExtension(unlimited_app.get());
ExtensionSet protecting_extensions;
ExtensionSet empty_set;
protecting_extensions.Insert(protected_app);
@@ -295,7 +295,7 @@ TEST_F(ExtensionSpecialStoragePolicyTest, OverlappingApps) {
EXPECT_TRUE(policy_->IsStorageUnlimited(GURL("https://bar.wildcards/")));
EXPECT_FALSE(policy_->IsStorageUnlimited(GURL("http://not_listed/")));
- policy_->RevokeRightsForExtension(unlimited_app);
+ policy_->RevokeRightsForExtension(unlimited_app.get());
protecting_extensions.Remove(unlimited_app->id());
EXPECT_FALSE(policy_->IsStorageUnlimited(GURL("http://explicit/")));
EXPECT_FALSE(policy_->IsStorageUnlimited(GURL("https://foo.wildcards/")));
@@ -304,7 +304,7 @@ TEST_F(ExtensionSpecialStoragePolicyTest, OverlappingApps) {
ExpectProtectedBy(protecting_extensions, GURL("http://foo.wildcards/"));
ExpectProtectedBy(protecting_extensions, GURL("https://bar.wildcards/"));
- policy_->RevokeRightsForExtension(protected_app);
+ policy_->RevokeRightsForExtension(protected_app.get());
ExpectProtectedBy(empty_set, GURL("http://explicit/"));
ExpectProtectedBy(empty_set, GURL("http://foo.wildcards/"));
ExpectProtectedBy(empty_set, GURL("https://bar.wildcards/"));
@@ -369,14 +369,14 @@ TEST_F(ExtensionSpecialStoragePolicyTest, NotificationTest) {
for (size_t i = 0; i < arraysize(apps); ++i) {
SCOPED_TRACE(testing::Message() << "i: " << i);
observer.ExpectGrant(apps[i]->id(), change_flags[i]);
- policy_->GrantRightsForExtension(apps[i]);
+ policy_->GrantRightsForExtension(apps[i].get());
message_loop.RunUntilIdle();
EXPECT_TRUE(observer.IsCompleted());
}
for (size_t i = 0; i < arraysize(apps); ++i) {
SCOPED_TRACE(testing::Message() << "i: " << i);
- policy_->GrantRightsForExtension(apps[i]);
+ policy_->GrantRightsForExtension(apps[i].get());
message_loop.RunUntilIdle();
EXPECT_TRUE(observer.IsCompleted());
}
@@ -384,14 +384,14 @@ TEST_F(ExtensionSpecialStoragePolicyTest, NotificationTest) {
for (size_t i = 0; i < arraysize(apps); ++i) {
SCOPED_TRACE(testing::Message() << "i: " << i);
observer.ExpectRevoke(apps[i]->id(), change_flags[i]);
- policy_->RevokeRightsForExtension(apps[i]);
+ policy_->RevokeRightsForExtension(apps[i].get());
message_loop.RunUntilIdle();
EXPECT_TRUE(observer.IsCompleted());
}
for (size_t i = 0; i < arraysize(apps); ++i) {
SCOPED_TRACE(testing::Message() << "i: " << i);
- policy_->RevokeRightsForExtension(apps[i]);
+ policy_->RevokeRightsForExtension(apps[i].get());
message_loop.RunUntilIdle();
EXPECT_TRUE(observer.IsCompleted());
}
« no previous file with comments | « chrome/browser/extensions/extension_special_storage_policy.cc ('k') | chrome/browser/extensions/extension_system.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698