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

Unified Diff: chrome/browser/chromeos/extensions/external_cache_unittest.cc

Issue 2765363004: Stop passing raw pointers to DictionaryValue::Set, part 2 (Closed)
Patch Set: Fix comments Created 3 years, 9 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/chromeos/extensions/external_cache_unittest.cc
diff --git a/chrome/browser/chromeos/extensions/external_cache_unittest.cc b/chrome/browser/chromeos/extensions/external_cache_unittest.cc
index 04f5e6dfd07de1a4f4dd8eee688021950cef3758..b95037bae618503754b0567d128979ecd40287a6 100644
--- a/chrome/browser/chromeos/extensions/external_cache_unittest.cc
+++ b/chrome/browser/chromeos/extensions/external_cache_unittest.cc
@@ -116,8 +116,9 @@ class ExternalCacheTest : public testing::Test,
return dir.Append(id + "-" + version + ".crx");
}
- base::DictionaryValue* CreateEntryWithUpdateUrl(bool from_webstore) {
- base::DictionaryValue* entry = new base::DictionaryValue;
+ std::unique_ptr<base::DictionaryValue> CreateEntryWithUpdateUrl(
+ bool from_webstore) {
+ auto entry = base::MakeUnique<base::DictionaryValue>();
entry->SetString(extensions::ExternalProviderImpl::kExternalUpdateUrl,
from_webstore ? extension_urls::GetWebstoreUpdateUrl().spec()
: kNonWebstoreUpdateUrl);
@@ -162,11 +163,9 @@ TEST_F(ExternalCacheTest, Basic) {
background_task_runner(), this, true, false);
std::unique_ptr<base::DictionaryValue> prefs(new base::DictionaryValue);
- base::DictionaryValue* dict = CreateEntryWithUpdateUrl(true);
- prefs->Set(kTestExtensionId1, dict);
+ prefs->Set(kTestExtensionId1, CreateEntryWithUpdateUrl(true));
CreateExtensionFile(cache_dir, kTestExtensionId1, "1");
- dict = CreateEntryWithUpdateUrl(true);
- prefs->Set(kTestExtensionId2, dict);
+ prefs->Set(kTestExtensionId2, CreateEntryWithUpdateUrl(true));
prefs->Set(kTestExtensionId3, CreateEntryWithUpdateUrl(false));
CreateExtensionFile(cache_dir, kTestExtensionId3, "3");
prefs->Set(kTestExtensionId4, CreateEntryWithUpdateUrl(false));

Powered by Google App Engine
This is Rietveld 408576698