| 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 <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 241 } | 241 } |
| 242 | 242 |
| 243 void TearDown() override { | 243 void TearDown() override { |
| 244 HistoryURLProviderTest::TearDown(); | 244 HistoryURLProviderTest::TearDown(); |
| 245 DefaultSearchManager::SetFallbackSearchEnginesDisabledForTesting(false); | 245 DefaultSearchManager::SetFallbackSearchEnginesDisabledForTesting(false); |
| 246 } | 246 } |
| 247 }; | 247 }; |
| 248 | 248 |
| 249 void HistoryURLProviderTest::OnProviderUpdate(bool updated_matches) { | 249 void HistoryURLProviderTest::OnProviderUpdate(bool updated_matches) { |
| 250 if (autocomplete_->done()) | 250 if (autocomplete_->done()) |
| 251 base::MessageLoop::current()->Quit(); | 251 base::MessageLoop::current()->QuitWhenIdle(); |
| 252 } | 252 } |
| 253 | 253 |
| 254 bool HistoryURLProviderTest::SetUpImpl(bool no_db) { | 254 bool HistoryURLProviderTest::SetUpImpl(bool no_db) { |
| 255 profile_.reset(new TestingProfile()); | 255 profile_.reset(new TestingProfile()); |
| 256 client_.reset(new ChromeAutocompleteProviderClient(profile_.get())); | 256 client_.reset(new ChromeAutocompleteProviderClient(profile_.get())); |
| 257 if (!(profile_->CreateHistoryService(true, no_db))) | 257 if (!(profile_->CreateHistoryService(true, no_db))) |
| 258 return false; | 258 return false; |
| 259 if (!no_db) { | 259 if (!no_db) { |
| 260 profile_->BlockUntilHistoryProcessesPendingRequests(); | 260 profile_->BlockUntilHistoryProcessesPendingRequests(); |
| 261 profile_->BlockUntilHistoryIndexIsRefreshed(); | 261 profile_->BlockUntilHistoryIndexIsRefreshed(); |
| (...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1054 // the default experimental scoring. | 1054 // the default experimental scoring. |
| 1055 autocomplete_->scoring_params_.experimental_scoring_enabled = true; | 1055 autocomplete_->scoring_params_.experimental_scoring_enabled = true; |
| 1056 ASSERT_NO_FATAL_FAILURE(RunTest(ASCIIToUTF16(test_cases[i].input), | 1056 ASSERT_NO_FATAL_FAILURE(RunTest(ASCIIToUTF16(test_cases[i].input), |
| 1057 std::string(), false, output, max_matches)); | 1057 std::string(), false, output, max_matches)); |
| 1058 for (int j = 0; j < max_matches; ++j) { | 1058 for (int j = 0; j < max_matches; ++j) { |
| 1059 EXPECT_EQ(test_cases[i].matches[j].experiment_relevance, | 1059 EXPECT_EQ(test_cases[i].matches[j].experiment_relevance, |
| 1060 matches_[j].relevance); | 1060 matches_[j].relevance); |
| 1061 } | 1061 } |
| 1062 } | 1062 } |
| 1063 } | 1063 } |
| OLD | NEW |