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

Side by Side Diff: chrome/browser/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 (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/ptr_util.h" 9 #include "base/memory/ptr_util.h"
10 #include "base/metrics/field_trial.h" 10 #include "base/metrics/field_trial.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 #include "chrome/browser/supervised_user/supervised_user_url_filter.h" 43 #include "chrome/browser/supervised_user/supervised_user_url_filter.h"
44 #endif 44 #endif
45 45
46 namespace search { 46 namespace search {
47 47
48 class SearchTest : public BrowserWithTestWindowTest { 48 class SearchTest : public BrowserWithTestWindowTest {
49 protected: 49 protected:
50 void SetUp() override { 50 void SetUp() override {
51 BrowserWithTestWindowTest::SetUp(); 51 BrowserWithTestWindowTest::SetUp();
52 field_trial_list_.reset(new base::FieldTrialList( 52 field_trial_list_.reset(new base::FieldTrialList(
53 new metrics::SHA1EntropyProvider("42"))); 53 base::MakeUnique<metrics::SHA1EntropyProvider>("42")));
54 TemplateURLServiceFactory::GetInstance()->SetTestingFactoryAndUse( 54 TemplateURLServiceFactory::GetInstance()->SetTestingFactoryAndUse(
55 profile(), &TemplateURLServiceFactory::BuildInstanceFor); 55 profile(), &TemplateURLServiceFactory::BuildInstanceFor);
56 TemplateURLService* template_url_service = 56 TemplateURLService* template_url_service =
57 TemplateURLServiceFactory::GetForProfile(profile()); 57 TemplateURLServiceFactory::GetForProfile(profile());
58 search_test_utils::WaitForTemplateURLServiceToLoad(template_url_service); 58 search_test_utils::WaitForTemplateURLServiceToLoad(template_url_service);
59 SetSearchProvider(true, false); 59 SetSearchProvider(true, false);
60 } 60 }
61 61
62 virtual void SetSearchProvider(bool set_ntp_url, bool insecure_ntp_url) { 62 virtual void SetSearchProvider(bool set_ntp_url, bool insecure_ntp_url) {
63 TemplateURLService* template_url_service = 63 TemplateURLService* template_url_service =
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 TemplateURLRef::SearchTermsArgs search_terms_args(base::ASCIIToUTF16("foo")); 667 TemplateURLRef::SearchTermsArgs search_terms_args(base::ASCIIToUTF16("foo"));
668 GURL result(template_url_->url_ref().ReplaceSearchTerms( 668 GURL result(template_url_->url_ref().ReplaceSearchTerms(
669 search_terms_args, UIThreadSearchTermsData(profile()))); 669 search_terms_args, UIThreadSearchTermsData(profile())));
670 ASSERT_TRUE(result.is_valid()); 670 ASSERT_TRUE(result.is_valid());
671 // Query extraction is disabled. Make sure 671 // Query extraction is disabled. Make sure
672 // {google:instantExtendedEnabledParameter} is not set in the search URL. 672 // {google:instantExtendedEnabledParameter} is not set in the search URL.
673 EXPECT_EQ("http://www.google.com/search?q=foo", result.spec()); 673 EXPECT_EQ("http://www.google.com/search?q=foo", result.spec());
674 } 674 }
675 675
676 } // namespace search 676 } // namespace search
OLDNEW
« no previous file with comments | « chrome/browser/search/instant_unittest_base.cc ('k') | chrome/browser/signin/cross_device_promo_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698