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

Unified Diff: components/bookmarks/managed/managed_bookmarks_tracker_unittest.cc

Issue 2287733002: Switch //components away from base::ListValue::Append(Value*) overload. (Closed)
Patch Set: Test fix Created 4 years, 4 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: components/bookmarks/managed/managed_bookmarks_tracker_unittest.cc
diff --git a/components/bookmarks/managed/managed_bookmarks_tracker_unittest.cc b/components/bookmarks/managed/managed_bookmarks_tracker_unittest.cc
index a3d3bb256aec74f46dc06e144e87f9e6eb621afa..2bd3ad6d57580243bcc630ae4a09e018d88be820 100644
--- a/components/bookmarks/managed/managed_bookmarks_tracker_unittest.cc
+++ b/components/bookmarks/managed/managed_bookmarks_tracker_unittest.cc
@@ -98,18 +98,20 @@ class ManagedBookmarksTrackerTest : public testing::Test {
return node && node->HasAncestor(managed_node_);
}
- static base::DictionaryValue* CreateBookmark(const std::string& title,
- const std::string& url) {
+ static std::unique_ptr<base::DictionaryValue> CreateBookmark(
+ const std::string& title,
+ const std::string& url) {
EXPECT_TRUE(GURL(url).is_valid());
- base::DictionaryValue* dict = new base::DictionaryValue();
+ std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
dict->SetString("name", title);
dict->SetString("url", GURL(url).spec());
return dict;
}
- static base::DictionaryValue* CreateFolder(const std::string& title,
- base::ListValue* children) {
- base::DictionaryValue* dict = new base::DictionaryValue();
+ static std::unique_ptr<base::DictionaryValue> CreateFolder(
+ const std::string& title,
+ base::ListValue* children) {
+ std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
dict->SetString("name", title);
dict->Set("children", children);
return dict;
@@ -137,7 +139,7 @@ class ManagedBookmarksTrackerTest : public testing::Test {
IDS_BOOKMARK_BAR_MANAGED_FOLDER_DEFAULT_NAME);
}
- static base::DictionaryValue* CreateExpectedTree() {
+ static std::unique_ptr<base::DictionaryValue> CreateExpectedTree() {
return CreateFolder(GetManagedFolderTitle(), CreateTestTree());
}

Powered by Google App Engine
This is Rietveld 408576698