Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(158)

Unified Diff: chrome/browser/autocomplete/history_quick_provider_unittest.cc

Issue 8359019: Create Private Data for InMemoryURLIndex (in Preparation for SQLite Cache) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/autocomplete/history_quick_provider.cc ('k') | chrome/browser/history/history_types.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autocomplete/history_quick_provider_unittest.cc
===================================================================
--- chrome/browser/autocomplete/history_quick_provider_unittest.cc (revision 107888)
+++ chrome/browser/autocomplete/history_quick_provider_unittest.cc (working copy)
@@ -142,6 +142,12 @@
void HistoryQuickProviderTest::FillData() {
history::URLDatabase* db = history_service_->InMemoryDatabase();
ASSERT_TRUE(db != NULL);
+
+ history::InMemoryURLIndex* index =
+ new history::InMemoryURLIndex(FilePath());
+ 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,19 +159,10 @@
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);
+ index->UpdateURL(i, url_info);
}
- history::InMemoryURLIndex* index = new history::InMemoryURLIndex(FilePath());
- 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(
« no previous file with comments | « chrome/browser/autocomplete/history_quick_provider.cc ('k') | chrome/browser/history/history_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698