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

Side by Side Diff: components/search/search_unittest.cc

Issue 1921923002: Convert //components/[o-t]* from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 7 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 "base/memory/scoped_ptr.h" 7 #include <memory>
8
8 #include "base/metrics/field_trial.h" 9 #include "base/metrics/field_trial.h"
9 #include "base/metrics/statistics_recorder.h" 10 #include "base/metrics/statistics_recorder.h"
10 #include "build/build_config.h" 11 #include "build/build_config.h"
11 #include "components/variations/entropy_provider.h" 12 #include "components/variations/entropy_provider.h"
12 #include "testing/gtest/include/gtest/gtest.h" 13 #include "testing/gtest/include/gtest/gtest.h"
13 14
14 namespace search { 15 namespace search {
15 16
16 class EmbeddedSearchFieldTrialTest : public testing::Test { 17 class EmbeddedSearchFieldTrialTest : public testing::Test {
17 protected: 18 protected:
18 void SetUp() override { 19 void SetUp() override {
19 field_trial_list_.reset(new base::FieldTrialList( 20 field_trial_list_.reset(new base::FieldTrialList(
20 new metrics::SHA1EntropyProvider("42"))); 21 new metrics::SHA1EntropyProvider("42")));
21 base::StatisticsRecorder::Initialize(); 22 base::StatisticsRecorder::Initialize();
22 } 23 }
23 24
24 private: 25 private:
25 scoped_ptr<base::FieldTrialList> field_trial_list_; 26 std::unique_ptr<base::FieldTrialList> field_trial_list_;
26 }; 27 };
27 28
28 TEST_F(EmbeddedSearchFieldTrialTest, GetFieldTrialInfoEmptyAndValid) { 29 TEST_F(EmbeddedSearchFieldTrialTest, GetFieldTrialInfoEmptyAndValid) {
29 FieldTrialFlags flags; 30 FieldTrialFlags flags;
30 31
31 EXPECT_TRUE(GetFieldTrialInfo(&flags)); 32 EXPECT_TRUE(GetFieldTrialInfo(&flags));
32 EXPECT_EQ(0ul, flags.size()); 33 EXPECT_EQ(0ul, flags.size());
33 34
34 ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial("EmbeddedSearch", 35 ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial("EmbeddedSearch",
35 "Group77")); 36 "Group77"));
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 EnableQueryExtractionForTesting(); 233 EnableQueryExtractionForTesting();
233 ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial( 234 ASSERT_TRUE(base::FieldTrialList::CreateFieldTrial(
234 "EmbeddedSearch", "Group1 espv:2 query_extraction:0")); 235 "EmbeddedSearch", "Group1 espv:2 query_extraction:0"));
235 EXPECT_TRUE(IsInstantExtendedAPIEnabled()); 236 EXPECT_TRUE(IsInstantExtendedAPIEnabled());
236 EXPECT_TRUE(IsQueryExtractionEnabled()); 237 EXPECT_TRUE(IsQueryExtractionEnabled());
237 EXPECT_EQ(2ul, EmbeddedSearchPageVersion()); 238 EXPECT_EQ(2ul, EmbeddedSearchPageVersion());
238 } 239 }
239 #endif // !defined(OS_IOS) && !defined(OS_ANDROID) 240 #endif // !defined(OS_IOS) && !defined(OS_ANDROID)
240 241
241 } // namespace search 242 } // namespace search
OLDNEW
« no previous file with comments | « components/search/search_android_unittest.cc ('k') | components/security_interstitials/core/bad_clock_ui.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698