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 "components/omnibox/browser/history_url_provider.h" | 5 #include "components/omnibox/browser/history_url_provider.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <memory> | 10 #include <memory> |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 {"http://7.com/4a", "Four A", 1, 1, 32}, | 154 {"http://7.com/4a", "Four A", 1, 1, 32}, |
155 {"http://7.com/4b", "Four B", 1, 1, 64}, | 155 {"http://7.com/4b", "Four B", 1, 1, 64}, |
156 {"http://7.com/5a", "Five A", 8, 0, 64}, // never typed. | 156 {"http://7.com/5a", "Five A", 8, 0, 64}, // never typed. |
157 }; | 157 }; |
158 | 158 |
159 class FakeAutocompleteProviderClient : public MockAutocompleteProviderClient { | 159 class FakeAutocompleteProviderClient : public MockAutocompleteProviderClient { |
160 public: | 160 public: |
161 FakeAutocompleteProviderClient(bool create_history_db) { | 161 FakeAutocompleteProviderClient(bool create_history_db) { |
162 set_template_url_service(base::MakeUnique<TemplateURLService>(nullptr, 0)); | 162 set_template_url_service(base::MakeUnique<TemplateURLService>(nullptr, 0)); |
163 if (history_dir_.CreateUniqueTempDir()) { | 163 if (history_dir_.CreateUniqueTempDir()) { |
164 history_service_ = history::CreateHistoryService( | 164 history_service_ = history::CreateHistoryService(history_dir_.GetPath(), |
165 history_dir_.path(), create_history_db); | 165 create_history_db); |
166 } | 166 } |
167 } | 167 } |
168 | 168 |
169 const AutocompleteSchemeClassifier& GetSchemeClassifier() const override { | 169 const AutocompleteSchemeClassifier& GetSchemeClassifier() const override { |
170 return scheme_classifier_; | 170 return scheme_classifier_; |
171 } | 171 } |
172 | 172 |
173 const SearchTermsData& GetSearchTermsData() const override { | 173 const SearchTermsData& GetSearchTermsData() const override { |
174 return search_terms_data_; | 174 return search_terms_data_; |
175 } | 175 } |
(...skipping 942 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1118 // the default experimental scoring. | 1118 // the default experimental scoring. |
1119 autocomplete_->scoring_params_.experimental_scoring_enabled = true; | 1119 autocomplete_->scoring_params_.experimental_scoring_enabled = true; |
1120 ASSERT_NO_FATAL_FAILURE(RunTest(ASCIIToUTF16(test_cases[i].input), | 1120 ASSERT_NO_FATAL_FAILURE(RunTest(ASCIIToUTF16(test_cases[i].input), |
1121 std::string(), false, output, max_matches)); | 1121 std::string(), false, output, max_matches)); |
1122 for (int j = 0; j < max_matches; ++j) { | 1122 for (int j = 0; j < max_matches; ++j) { |
1123 EXPECT_EQ(test_cases[i].matches[j].experiment_relevance, | 1123 EXPECT_EQ(test_cases[i].matches[j].experiment_relevance, |
1124 matches_[j].relevance); | 1124 matches_[j].relevance); |
1125 } | 1125 } |
1126 } | 1126 } |
1127 } | 1127 } |
OLD | NEW |