diff options
author | sky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-27 03:27:46 +0000 |
---|---|---|
committer | sky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-27 03:27:46 +0000 |
commit | 90ef1313cb672e7da91312c4f7d3cdee41c7a767 (patch) | |
tree | b42df35c8c71ca921bf7900beb537a1773debacf /chrome/test/testing_profile.cc | |
parent | 7459794d5e6251014e322a4042d68c4f3f19a5f3 (diff) | |
download | chromium_src-90ef1313cb672e7da91312c4f7d3cdee41c7a767.zip chromium_src-90ef1313cb672e7da91312c4f7d3cdee41c7a767.tar.gz chromium_src-90ef1313cb672e7da91312c4f7d3cdee41c7a767.tar.bz2 |
Makes deleting history no longer delete starred urls. Thiseffectively reenables the code in ExpireHistoryBackend. I also madethe code consistent so that when we delete visits as the result ofhistory deletion we don't change the typed/visit count of theunderlying url.BUG=1214201 1256202TEST=none
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1423 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/test/testing_profile.cc')
-rw-r--r-- | chrome/test/testing_profile.cc | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/chrome/test/testing_profile.cc b/chrome/test/testing_profile.cc index 7cc0455..c91c372 100644 --- a/chrome/test/testing_profile.cc +++ b/chrome/test/testing_profile.cc @@ -4,6 +4,7 @@ #include "chrome/test/testing_profile.h" +#include "chrome/browser/history/history_backend.h" #include "chrome/common/chrome_constants.h" TestingProfile::TestingProfile() @@ -30,9 +31,8 @@ void TestingProfile::CreateHistoryService(bool delete_file) { file_util::AppendToPath(&path, chrome::kHistoryFilename); file_util::Delete(path, false); } - file_util::CreateDirectory(history_dir_); - history_service_ = new HistoryService(); - history_service_->Init(GetPath()); + history_service_ = new HistoryService(this); + history_service_->Init(GetPath(), bookmark_bar_model_.get()); } void TestingProfile::DestroyHistoryService() { @@ -56,11 +56,23 @@ void TestingProfile::DestroyHistoryService() { MessageLoop::current()->Run(); } -void TestingProfile::CreateBookmarkBarModel() { - std::wstring path = GetPath(); - file_util::AppendToPath(&path, chrome::kBookmarksFileName); - file_util::Delete(path, false); +void TestingProfile::CreateBookmarkBarModel(bool delete_file) { + // Nuke the model first, that way we're sure it's done writing to disk. + bookmark_bar_model_.reset(NULL); + + if (delete_file) { + std::wstring path = GetPath(); + file_util::AppendToPath(&path, chrome::kBookmarksFileName); + file_util::Delete(path, false); + } bookmark_bar_model_.reset(new BookmarkBarModel(this)); + if (history_service_.get()) { + history_service_->history_backend_->bookmark_service_ = + bookmark_bar_model_.get(); + history_service_->history_backend_->expirer_.bookmark_service_ = + bookmark_bar_model_.get(); + } + bookmark_bar_model_->Load(); } void TestingProfile::CreateTemplateURLModel() { |