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

Unified Diff: components/variations/entropy_provider_unittest.cc

Issue 2358723002: Convert FieldTrialList to Accept a std::unique_ptr (Closed)
Patch Set: Change Comment nullptr to null Created 4 years, 3 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/variations/entropy_provider_unittest.cc
diff --git a/components/variations/entropy_provider_unittest.cc b/components/variations/entropy_provider_unittest.cc
index 3c679dd0bc134527d078bbea322d0468380f362b..cde08e0aed9c1505455a3b3a32e6bba5db131d8c 100644
--- a/components/variations/entropy_provider_unittest.cc
+++ b/components/variations/entropy_provider_unittest.cc
@@ -13,6 +13,7 @@
#include "base/guid.h"
#include "base/macros.h"
+#include "base/memory/ptr_util.h"
#include "base/rand_util.h"
#include "base/strings/string_number_conversions.h"
#include "components/variations/metrics_util.h"
@@ -189,7 +190,8 @@ TEST(EntropyProviderTest, UseOneTimeRandomizationSHA1) {
// Note that depending on the one-time random initialization, they
// _might_ actually give the same result, but we know that given
// the particular client_id we use for unit tests they won't.
- base::FieldTrialList field_trial_list(new SHA1EntropyProvider("client_id"));
+ base::FieldTrialList field_trial_list(
+ base::MakeUnique<SHA1EntropyProvider>("client_id"));
const int kNoExpirationYear = base::FieldTrialList::kNoExpirationYear;
scoped_refptr<base::FieldTrial> trials[] = {
base::FieldTrialList::FactoryGetFieldTrial(
@@ -219,7 +221,7 @@ TEST(EntropyProviderTest, UseOneTimeRandomizationPermuted) {
// _might_ actually give the same result, but we know that given
// the particular client_id we use for unit tests they won't.
base::FieldTrialList field_trial_list(
- new PermutedEntropyProvider(1234, kMaxLowEntropySize));
+ base::MakeUnique<PermutedEntropyProvider>(1234, kMaxLowEntropySize));
const int kNoExpirationYear = base::FieldTrialList::kNoExpirationYear;
scoped_refptr<base::FieldTrial> trials[] = {
base::FieldTrialList::FactoryGetFieldTrial(
@@ -245,7 +247,7 @@ TEST(EntropyProviderTest, UseOneTimeRandomizationWithCustomSeedPermuted) {
// Ensures that two trials with different names but the same custom seed used
// for one time randomization produce the same group assignments.
base::FieldTrialList field_trial_list(
- new PermutedEntropyProvider(1234, kMaxLowEntropySize));
+ base::MakeUnique<PermutedEntropyProvider>(1234, kMaxLowEntropySize));
const int kNoExpirationYear = base::FieldTrialList::kNoExpirationYear;
const uint32_t kCustomSeed = 9001;
scoped_refptr<base::FieldTrial> trials[] = {
« no previous file with comments | « components/spellcheck/browser/feedback_sender_unittest.cc ('k') | components/variations/variations_seed_processor_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698