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

Unified Diff: ios/chrome/browser/ui/settings/utils/pref_backed_boolean_unittest.mm

Issue 2782553004: Move TestingPrefService to use unique_ptr<Value> (Closed)
Patch Set: 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
« no previous file with comments | « components/translate/core/browser/translate_prefs_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/ui/settings/utils/pref_backed_boolean_unittest.mm
diff --git a/ios/chrome/browser/ui/settings/utils/pref_backed_boolean_unittest.mm b/ios/chrome/browser/ui/settings/utils/pref_backed_boolean_unittest.mm
index 6ca46bcf2045ea15786e609e13d56314e2550d4e..2584c248b33e7b1b47ed9e93d7eb7b4ee1f58fa8 100644
--- a/ios/chrome/browser/ui/settings/utils/pref_backed_boolean_unittest.mm
+++ b/ios/chrome/browser/ui/settings/utils/pref_backed_boolean_unittest.mm
@@ -4,6 +4,9 @@
#import "ios/chrome/browser/ui/settings/utils/pref_backed_boolean.h"
+#include <utility>
+
+#include "base/memory/ptr_util.h"
#include "base/values.h"
#include "components/prefs/pref_registry_simple.h"
#include "components/prefs/testing_pref_service.h"
@@ -33,8 +36,8 @@ class PrefBackedBooleanTest : public PlatformTest {
bool GetPref() { return pref_service_.GetBoolean(kTestSwitchPref); }
void SetPref(bool value) {
- base::Value* booleanValue = new base::Value(value);
- pref_service_.SetUserPref(kTestSwitchPref, booleanValue);
+ auto booleanValue = base::MakeUnique<base::Value>(value);
+ pref_service_.SetUserPref(kTestSwitchPref, std::move(booleanValue));
}
PrefBackedBoolean* GetObservableBoolean() { return observable_boolean_; }
« no previous file with comments | « components/translate/core/browser/translate_prefs_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698