| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |