summaryrefslogtreecommitdiffstats
path: root/chrome/test/testing_profile.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/test/testing_profile.cc')
-rw-r--r--chrome/test/testing_profile.cc23
1 files changed, 23 insertions, 0 deletions
diff --git a/chrome/test/testing_profile.cc b/chrome/test/testing_profile.cc
index e5d6740..c6238c0 100644
--- a/chrome/test/testing_profile.cc
+++ b/chrome/test/testing_profile.cc
@@ -134,6 +134,7 @@ TestingProfile::TestingProfile(int count)
TestingProfile::~TestingProfile() {
DestroyHistoryService();
+ DestroyWebDataService();
file_util::Delete(path_, true);
}
@@ -192,6 +193,21 @@ void TestingProfile::CreateBookmarkModel(bool delete_file) {
bookmark_bar_model_->Load();
}
+void TestingProfile::CreateWebDataService(bool delete_file) {
+ if (web_data_service_.get())
+ web_data_service_->Shutdown();
+
+ if (delete_file) {
+ FilePath path = GetPath();
+ path = path.Append(chrome::kWebDataFilename);
+ file_util::Delete(path, false);
+ }
+
+ web_data_service_ = new WebDataService;
+ if (web_data_service_.get())
+ web_data_service_->Init(GetPath());
+}
+
void TestingProfile::BlockUntilBookmarkModelLoaded() {
DCHECK(bookmark_bar_model_.get());
if (bookmark_bar_model_->IsLoaded())
@@ -265,3 +281,10 @@ void TestingProfile::CreateProfileSyncService() {
ProfileSyncService* TestingProfile::GetProfileSyncService() {
return profile_sync_service_.get();
}
+
+void TestingProfile::DestroyWebDataService() {
+ if (!web_data_service_.get())
+ return;
+
+ web_data_service_->Shutdown();
+}