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

Unified Diff: components/user_prefs/tracked/pref_hash_calculator_unittest.cc

Issue 1908143002: Convert //components/user_prefs from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Restore the rightful glory of <windows.h> Created 4 years, 8 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/user_prefs/tracked/pref_hash_calculator_unittest.cc
diff --git a/components/user_prefs/tracked/pref_hash_calculator_unittest.cc b/components/user_prefs/tracked/pref_hash_calculator_unittest.cc
index 2385b6c077b0fcdaf99a79756293306f47b54148..a2de0466ef20d93a44c8e524c3a871b651accd75 100644
--- a/components/user_prefs/tracked/pref_hash_calculator_unittest.cc
+++ b/components/user_prefs/tracked/pref_hash_calculator_unittest.cc
@@ -4,10 +4,10 @@
#include "components/user_prefs/tracked/pref_hash_calculator.h"
+#include <memory>
#include <string>
#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
#include "base/strings/string_util.h"
#include "base/values.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -75,28 +75,29 @@ TEST(PrefHashCalculatorTest, CatchHashChanges) {
static const char kSeed[] = "0123456789ABCDEF0123456789ABCDEF";
static const char kDeviceId[] = "test_device_id1";
- scoped_ptr<base::Value> null_value = base::Value::CreateNullValue();
- scoped_ptr<base::Value> bool_value(new base::FundamentalValue(false));
- scoped_ptr<base::Value> int_value(new base::FundamentalValue(1234567890));
- scoped_ptr<base::Value> double_value(
+ std::unique_ptr<base::Value> null_value = base::Value::CreateNullValue();
+ std::unique_ptr<base::Value> bool_value(new base::FundamentalValue(false));
+ std::unique_ptr<base::Value> int_value(
+ new base::FundamentalValue(1234567890));
+ std::unique_ptr<base::Value> double_value(
new base::FundamentalValue(123.0987654321));
- scoped_ptr<base::Value> string_value(
+ std::unique_ptr<base::Value> string_value(
new base::StringValue("testing with special chars:\n<>{}:^^@#$\\/"));
// For legacy reasons, we have to support pruning of empty lists/dictionaries
// and nested empty ists/dicts in the hash generation algorithm.
- scoped_ptr<base::DictionaryValue> nested_empty_dict(
+ std::unique_ptr<base::DictionaryValue> nested_empty_dict(
new base::DictionaryValue);
nested_empty_dict->Set("a", new base::DictionaryValue);
nested_empty_dict->Set("b", new base::ListValue);
- scoped_ptr<base::ListValue> nested_empty_list(new base::ListValue);
+ std::unique_ptr<base::ListValue> nested_empty_list(new base::ListValue);
nested_empty_list->Append(new base::DictionaryValue);
nested_empty_list->Append(new base::ListValue);
nested_empty_list->Append(nested_empty_dict->DeepCopy());
// A dictionary with an empty dictionary, an empty list, and nested empty
// dictionaries/lists in it.
- scoped_ptr<base::DictionaryValue> dict_value(new base::DictionaryValue);
+ std::unique_ptr<base::DictionaryValue> dict_value(new base::DictionaryValue);
dict_value->Set("a", new base::StringValue("foo"));
dict_value->Set("d", new base::ListValue);
dict_value->Set("b", new base::DictionaryValue);
@@ -104,7 +105,7 @@ TEST(PrefHashCalculatorTest, CatchHashChanges) {
dict_value->Set("e", nested_empty_dict.release());
dict_value->Set("f", nested_empty_list.release());
- scoped_ptr<base::ListValue> list_value(new base::ListValue);
+ std::unique_ptr<base::ListValue> list_value(new base::ListValue);
list_value->AppendBoolean(true);
list_value->AppendInteger(100);
list_value->AppendDouble(1.0);
« no previous file with comments | « components/user_prefs/tracked/pref_hash_calculator.cc ('k') | components/user_prefs/tracked/pref_hash_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698