Index: chrome/browser/extensions/api/bookmarks/bookmark_apitest.cc |
diff --git a/chrome/browser/extensions/api/bookmarks/bookmark_apitest.cc b/chrome/browser/extensions/api/bookmarks/bookmark_apitest.cc |
index c277146c3141fa4b24b3e190b6bbae72e073e226..39fd91418f5d6f1c2a267cf7a422cb80dafb374f 100644 |
--- a/chrome/browser/extensions/api/bookmarks/bookmark_apitest.cc |
+++ b/chrome/browser/extensions/api/bookmarks/bookmark_apitest.cc |
@@ -2,6 +2,9 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
+#include <memory> |
+#include <utility> |
+ |
#include "base/values.h" |
#include "build/build_config.h" |
#include "chrome/browser/bookmarks/bookmark_model_factory.h" |
@@ -35,28 +38,28 @@ IN_PROC_BROWSER_TEST_F(ExtensionApiTest, MAYBE_Bookmarks) { |
{ |
base::ListValue list; |
- base::DictionaryValue* node = new base::DictionaryValue(); |
+ std::unique_ptr<base::DictionaryValue> node(new base::DictionaryValue()); |
node->SetString("name", "Managed Bookmark"); |
node->SetString("url", "http://www.chromium.org"); |
- list.Append(node); |
- node = new base::DictionaryValue(); |
+ list.Append(std::move(node)); |
+ node.reset(new base::DictionaryValue()); |
node->SetString("name", "Managed Folder"); |
node->Set("children", new base::ListValue()); |
- list.Append(node); |
+ list.Append(std::move(node)); |
profile->GetPrefs()->Set(bookmarks::prefs::kManagedBookmarks, list); |
ASSERT_EQ(2, managed->managed_node()->child_count()); |
} |
{ |
base::ListValue list; |
- base::DictionaryValue* node = new base::DictionaryValue(); |
+ std::unique_ptr<base::DictionaryValue> node(new base::DictionaryValue()); |
node->SetString("name", "Supervised Bookmark"); |
node->SetString("url", "http://www.pbskids.org"); |
- list.Append(node); |
- node = new base::DictionaryValue(); |
+ list.Append(std::move(node)); |
+ node.reset(new base::DictionaryValue()); |
node->SetString("name", "Supervised Folder"); |
node->Set("children", new base::ListValue()); |
- list.Append(node); |
+ list.Append(std::move(node)); |
profile->GetPrefs()->Set(bookmarks::prefs::kSupervisedBookmarks, list); |
ASSERT_EQ(2, managed->supervised_node()->child_count()); |
} |