| 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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 struct UrlAndLegalDefault { | 156 struct UrlAndLegalDefault { |
| 157 std::string url; | 157 std::string url; |
| 158 bool allowed_to_be_default_match; | 158 bool allowed_to_be_default_match; |
| 159 }; | 159 }; |
| 160 | 160 |
| 161 HistoryURLProviderTest() | 161 HistoryURLProviderTest() |
| 162 : sort_matches_(false) { | 162 : sort_matches_(false) { |
| 163 HistoryQuickProvider::set_disabled(true); | 163 HistoryQuickProvider::set_disabled(true); |
| 164 } | 164 } |
| 165 | 165 |
| 166 virtual ~HistoryURLProviderTest() { | 166 ~HistoryURLProviderTest() override { |
| 167 HistoryQuickProvider::set_disabled(false); | 167 HistoryQuickProvider::set_disabled(false); |
| 168 } | 168 } |
| 169 | 169 |
| 170 // AutocompleteProviderListener: | 170 // AutocompleteProviderListener: |
| 171 void OnProviderUpdate(bool updated_matches) override; | 171 void OnProviderUpdate(bool updated_matches) override; |
| 172 | 172 |
| 173 protected: | 173 protected: |
| 174 static KeyedService* CreateTemplateURLService( | 174 static KeyedService* CreateTemplateURLService( |
| 175 content::BrowserContext* context) { | 175 content::BrowserContext* context) { |
| 176 Profile* profile = static_cast<Profile*>(context); | 176 Profile* profile = static_cast<Profile*>(context); |
| (...skipping 846 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1023 // Test the experiment (scoring enabled). | 1023 // Test the experiment (scoring enabled). |
| 1024 autocomplete_->scoring_params_.experimental_scoring_enabled = true; | 1024 autocomplete_->scoring_params_.experimental_scoring_enabled = true; |
| 1025 ASSERT_NO_FATAL_FAILURE(RunTest(ASCIIToUTF16(test_cases[i].input), | 1025 ASSERT_NO_FATAL_FAILURE(RunTest(ASCIIToUTF16(test_cases[i].input), |
| 1026 std::string(), false, output, max_matches)); | 1026 std::string(), false, output, max_matches)); |
| 1027 for (int j = 0; j < max_matches; ++j) { | 1027 for (int j = 0; j < max_matches; ++j) { |
| 1028 EXPECT_EQ(test_cases[i].matches[j].experiment_relevance, | 1028 EXPECT_EQ(test_cases[i].matches[j].experiment_relevance, |
| 1029 matches_[j].relevance); | 1029 matches_[j].relevance); |
| 1030 } | 1030 } |
| 1031 } | 1031 } |
| 1032 } | 1032 } |
| OLD | NEW |