summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autocomplete/history_quick_provider_unittest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/autocomplete/history_quick_provider_unittest.cc')
-rw-r--r--chrome/browser/autocomplete/history_quick_provider_unittest.cc22
1 files changed, 10 insertions, 12 deletions
diff --git a/chrome/browser/autocomplete/history_quick_provider_unittest.cc b/chrome/browser/autocomplete/history_quick_provider_unittest.cc
index f936860..65b7654 100644
--- a/chrome/browser/autocomplete/history_quick_provider_unittest.cc
+++ b/chrome/browser/autocomplete/history_quick_provider_unittest.cc
@@ -142,6 +142,13 @@ void HistoryQuickProviderTest::OnProviderUpdate(bool updated_matches) {
void HistoryQuickProviderTest::FillData() {
history::URLDatabase* db = history_service_->InMemoryDatabase();
ASSERT_TRUE(db != NULL);
+
+ history::InMemoryURLIndex* index =
+ new history::InMemoryURLIndex(profile_.get(),
+ FilePath(FILE_PATH_LITERAL("/dummy")));
+ PrefService* prefs = profile_->GetPrefs();
+ std::string languages(prefs->GetString(prefs::kAcceptLanguages));
+ index->Init(db, languages);
for (size_t i = 0; i < arraysize(quick_test_db); ++i) {
const TestURLInfo& cur = quick_test_db[i];
const GURL current_url(cur.url);
@@ -153,20 +160,11 @@ void HistoryQuickProviderTest::FillData() {
url_info.set_typed_count(cur.typed_count);
url_info.set_last_visit(visit_time);
url_info.set_hidden(false);
- EXPECT_TRUE(db->AddURL(url_info));
-
- history_service_->AddPageWithDetails(current_url, UTF8ToUTF16(cur.title),
- cur.visit_count, cur.typed_count,
- visit_time, false,
- history::SOURCE_BROWSED);
+ url_info.set_id(i);
+ index->UpdateURL(url_info);
}
- history::InMemoryURLIndex* index =
- new history::InMemoryURLIndex(FilePath(FILE_PATH_LITERAL("/dummy")));
- PrefService* prefs = profile_->GetPrefs();
- std::string languages(prefs->GetString(prefs::kAcceptLanguages));
- index->Init(db, languages);
- provider_->SetIndexForTesting(index);
+ provider_->set_index(index);
}
HistoryQuickProviderTest::SetShouldContain::SetShouldContain(