OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/autocomplete/history_url_provider.h" | 5 #include "chrome/browser/autocomplete/history_url_provider.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 HistoryURLProviderTest() | 160 HistoryURLProviderTest() |
161 : sort_matches_(false) { | 161 : sort_matches_(false) { |
162 HistoryQuickProvider::set_disabled(true); | 162 HistoryQuickProvider::set_disabled(true); |
163 } | 163 } |
164 | 164 |
165 virtual ~HistoryURLProviderTest() { | 165 virtual ~HistoryURLProviderTest() { |
166 HistoryQuickProvider::set_disabled(false); | 166 HistoryQuickProvider::set_disabled(false); |
167 } | 167 } |
168 | 168 |
169 // AutocompleteProviderListener: | 169 // AutocompleteProviderListener: |
170 virtual void OnProviderUpdate(bool updated_matches) override; | 170 void OnProviderUpdate(bool updated_matches) override; |
171 | 171 |
172 protected: | 172 protected: |
173 static KeyedService* CreateTemplateURLService( | 173 static KeyedService* CreateTemplateURLService( |
174 content::BrowserContext* context) { | 174 content::BrowserContext* context) { |
175 Profile* profile = static_cast<Profile*>(context); | 175 Profile* profile = static_cast<Profile*>(context); |
176 return new TemplateURLService( | 176 return new TemplateURLService( |
177 profile->GetPrefs(), make_scoped_ptr(new SearchTermsData), NULL, | 177 profile->GetPrefs(), make_scoped_ptr(new SearchTermsData), NULL, |
178 scoped_ptr<TemplateURLServiceClient>( | 178 scoped_ptr<TemplateURLServiceClient>( |
179 new ChromeTemplateURLServiceClient( | 179 new ChromeTemplateURLServiceClient( |
180 HistoryServiceFactory::GetForProfile( | 180 HistoryServiceFactory::GetForProfile( |
(...skipping 808 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
989 // Test the experiment (scoring enabled). | 989 // Test the experiment (scoring enabled). |
990 autocomplete_->scoring_params_.experimental_scoring_enabled = true; | 990 autocomplete_->scoring_params_.experimental_scoring_enabled = true; |
991 ASSERT_NO_FATAL_FAILURE(RunTest(ASCIIToUTF16(test_cases[i].input), | 991 ASSERT_NO_FATAL_FAILURE(RunTest(ASCIIToUTF16(test_cases[i].input), |
992 std::string(), false, output, max_matches)); | 992 std::string(), false, output, max_matches)); |
993 for (int j = 0; j < max_matches; ++j) { | 993 for (int j = 0; j < max_matches; ++j) { |
994 EXPECT_EQ(test_cases[i].matches[j].experiment_relevance, | 994 EXPECT_EQ(test_cases[i].matches[j].experiment_relevance, |
995 matches_[j].relevance); | 995 matches_[j].relevance); |
996 } | 996 } |
997 } | 997 } |
998 } | 998 } |
OLD | NEW |