| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/search_provider.h" | 5 #include "chrome/browser/autocomplete/search_provider.h" |
| 6 | 6 |
| 7 #include "base/metrics/field_trial.h" | 7 #include "base/metrics/field_trial.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 | 217 |
| 218 // Add a page and search term for keyword_t_url_. | 218 // Add a page and search term for keyword_t_url_. |
| 219 keyword_url_ = AddSearchToHistory(keyword_t_url_, keyword_term_, 1); | 219 keyword_url_ = AddSearchToHistory(keyword_t_url_, keyword_term_, 1); |
| 220 | 220 |
| 221 // Keywords are updated by the InMemoryHistoryBackend only after the message | 221 // Keywords are updated by the InMemoryHistoryBackend only after the message |
| 222 // has been processed on the history thread. Block until history processes all | 222 // has been processed on the history thread. Block until history processes all |
| 223 // requests to ensure the InMemoryDatabase is the state we expect it. | 223 // requests to ensure the InMemoryDatabase is the state we expect it. |
| 224 profile_.BlockUntilHistoryProcessesPendingRequests(); | 224 profile_.BlockUntilHistoryProcessesPendingRequests(); |
| 225 | 225 |
| 226 provider_ = new SearchProvider(this, &profile_); | 226 provider_ = new SearchProvider(this, &profile_); |
| 227 provider_->kMinimumTimeBetweenSuggestQueriesMs = 0; |
| 227 } | 228 } |
| 228 | 229 |
| 229 void SearchProviderTest::OnProviderUpdate(bool updated_matches) { | 230 void SearchProviderTest::OnProviderUpdate(bool updated_matches) { |
| 230 if (quit_when_done_ && provider_->done()) { | 231 if (quit_when_done_ && provider_->done()) { |
| 231 quit_when_done_ = false; | 232 quit_when_done_ = false; |
| 232 message_loop_.Quit(); | 233 message_loop_.Quit(); |
| 233 } | 234 } |
| 234 } | 235 } |
| 235 | 236 |
| 236 net::TestURLFetcher* SearchProviderTest::WaitUntilURLFetcherIsReady( | 237 net::TestURLFetcher* SearchProviderTest::WaitUntilURLFetcherIsReady( |
| (...skipping 1725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1962 EXPECT_EQ(AutocompleteMatch::ACMatchClassification::URL, | 1963 EXPECT_EQ(AutocompleteMatch::ACMatchClassification::URL, |
| 1963 match.contents_class[0].style); | 1964 match.contents_class[0].style); |
| 1964 EXPECT_EQ(4U, match.contents_class[1].offset); | 1965 EXPECT_EQ(4U, match.contents_class[1].offset); |
| 1965 EXPECT_EQ(AutocompleteMatch::ACMatchClassification::URL | | 1966 EXPECT_EQ(AutocompleteMatch::ACMatchClassification::URL | |
| 1966 AutocompleteMatch::ACMatchClassification::MATCH, | 1967 AutocompleteMatch::ACMatchClassification::MATCH, |
| 1967 match.contents_class[1].style); | 1968 match.contents_class[1].style); |
| 1968 EXPECT_EQ(5U, match.contents_class[2].offset); | 1969 EXPECT_EQ(5U, match.contents_class[2].offset); |
| 1969 EXPECT_EQ(AutocompleteMatch::ACMatchClassification::URL, | 1970 EXPECT_EQ(AutocompleteMatch::ACMatchClassification::URL, |
| 1970 match.contents_class[2].style); | 1971 match.contents_class[2].style); |
| 1971 } | 1972 } |
| OLD | NEW |