| 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/metrics/field_trial.h" | 6 #include "base/metrics/field_trial.h" |
| 7 #include "base/metrics/histogram_base.h" | 7 #include "base/metrics/histogram_base.h" |
| 8 #include "base/metrics/histogram_samples.h" | 8 #include "base/metrics/histogram_samples.h" |
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 741 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 752 for (size_t i = 0; i < arraysize(kTestCases); ++i) { | 752 for (size_t i = 0; i < arraysize(kTestCases); ++i) { |
| 753 const QueryExtractionAllowedTestCase& test = kTestCases[i]; | 753 const QueryExtractionAllowedTestCase& test = kTestCases[i]; |
| 754 EXPECT_EQ(test.expected_result, | 754 EXPECT_EQ(test.expected_result, |
| 755 chrome::IsQueryExtractionAllowedForURL(profile(), GURL(test.url))) | 755 chrome::IsQueryExtractionAllowedForURL(profile(), GURL(test.url))) |
| 756 << test.url << " " << test.comment; | 756 << test.url << " " << test.comment; |
| 757 } | 757 } |
| 758 } | 758 } |
| 759 | 759 |
| 760 class SearchURLTest : public SearchTest { | 760 class SearchURLTest : public SearchTest { |
| 761 protected: | 761 protected: |
| 762 virtual void SetSearchProvider(bool set_ntp_url, bool insecure_ntp_url) | 762 void SetSearchProvider(bool set_ntp_url, bool insecure_ntp_url) override { |
| 763 override { | |
| 764 TemplateURLService* template_url_service = | 763 TemplateURLService* template_url_service = |
| 765 TemplateURLServiceFactory::GetForProfile(profile()); | 764 TemplateURLServiceFactory::GetForProfile(profile()); |
| 766 TemplateURLData data; | 765 TemplateURLData data; |
| 767 data.SetURL("{google:baseURL}search?" | 766 data.SetURL("{google:baseURL}search?" |
| 768 "{google:instantExtendedEnabledParameter}q={searchTerms}"); | 767 "{google:instantExtendedEnabledParameter}q={searchTerms}"); |
| 769 data.search_terms_replacement_key = "espv"; | 768 data.search_terms_replacement_key = "espv"; |
| 770 template_url_ = new TemplateURL(data); | 769 template_url_ = new TemplateURL(data); |
| 771 // |template_url_service| takes ownership of |template_url_|. | 770 // |template_url_service| takes ownership of |template_url_|. |
| 772 template_url_service->Add(template_url_); | 771 template_url_service->Add(template_url_); |
| 773 template_url_service->SetUserSelectedDefaultSearchProvider(template_url_); | 772 template_url_service->SetUserSelectedDefaultSearchProvider(template_url_); |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1005 } | 1004 } |
| 1006 | 1005 |
| 1007 TEST_F(OriginChipTest, CommandLineOnSrp) { | 1006 TEST_F(OriginChipTest, CommandLineOnSrp) { |
| 1008 CommandLine::ForCurrentProcess()->AppendSwitch( | 1007 CommandLine::ForCurrentProcess()->AppendSwitch( |
| 1009 switches::kEnableOriginChipOnSrp); | 1008 switches::kEnableOriginChipOnSrp); |
| 1010 EXPECT_TRUE(ShouldDisplayOriginChip()); | 1009 EXPECT_TRUE(ShouldDisplayOriginChip()); |
| 1011 EXPECT_EQ(ORIGIN_CHIP_ON_SRP, GetOriginChipCondition()); | 1010 EXPECT_EQ(ORIGIN_CHIP_ON_SRP, GetOriginChipCondition()); |
| 1012 } | 1011 } |
| 1013 | 1012 |
| 1014 } // namespace chrome | 1013 } // namespace chrome |
| OLD | NEW |