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

Side by Side Diff: components/search/search_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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/search/search.h" 5 #include "components/search/search.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/memory/ptr_util.h"
9 #include "base/metrics/field_trial.h" 10 #include "base/metrics/field_trial.h"
10 #include "base/metrics/statistics_recorder.h" 11 #include "base/metrics/statistics_recorder.h"
11 #include "build/build_config.h" 12 #include "build/build_config.h"
12 #include "components/variations/entropy_provider.h" 13 #include "components/variations/entropy_provider.h"
13 #include "testing/gtest/include/gtest/gtest.h" 14 #include "testing/gtest/include/gtest/gtest.h"
14 15
15 namespace search { 16 namespace search {
16 17
17 class EmbeddedSearchFieldTrialTest : public testing::Test { 18 class EmbeddedSearchFieldTrialTest : public testing::Test {
18 protected: 19 protected:
19 void SetUp() override { 20 void SetUp() override {
20 field_trial_list_.reset(new base::FieldTrialList( 21 field_trial_list_.reset(new base::FieldTrialList(
21 new metrics::SHA1EntropyProvider("42"))); 22 base::MakeUnique<metrics::SHA1EntropyProvider>("42")));
22 base::StatisticsRecorder::Initialize(); 23 base::StatisticsRecorder::Initialize();
23 } 24 }
24 25
25 private: 26 private:
26 std::unique_ptr<base::FieldTrialList> field_trial_list_; 27 std::unique_ptr<base::FieldTrialList> field_trial_list_;
27 }; 28 };
28 29
29 TEST_F(EmbeddedSearchFieldTrialTest, GetFieldTrialInfoEmptyAndValid) { 30 TEST_F(EmbeddedSearchFieldTrialTest, GetFieldTrialInfoEmptyAndValid) {
30 FieldTrialFlags flags; 31 FieldTrialFlags flags;
31 32
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 TEST_F(InstantExtendedEnabledParamTest, UseDefaultEmbeddedSearchPageVersion) { 174 TEST_F(InstantExtendedEnabledParamTest, UseDefaultEmbeddedSearchPageVersion) {
174 ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial( 175 ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial(
175 "EmbeddedSearch", "Group1 espv:-1")); 176 "EmbeddedSearch", "Group1 espv:-1"));
176 EXPECT_EQ("", InstantExtendedEnabledParam(true)); 177 EXPECT_EQ("", InstantExtendedEnabledParam(true));
177 EXPECT_EQ("espv=2&", InstantExtendedEnabledParam(false)); 178 EXPECT_EQ("espv=2&", InstantExtendedEnabledParam(false));
178 } 179 }
179 180
180 #endif // !defined(OS_IOS) && !defined(OS_ANDROID) 181 #endif // !defined(OS_IOS) && !defined(OS_ANDROID)
181 182
182 } // namespace search 183 } // namespace search
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698