| Index: chrome/test/testing_profile.cc
|
| ===================================================================
|
| --- chrome/test/testing_profile.cc (revision 36778)
|
| +++ chrome/test/testing_profile.cc (working copy)
|
| @@ -134,6 +134,7 @@
|
|
|
| TestingProfile::~TestingProfile() {
|
| DestroyHistoryService();
|
| + DestroyWebDataService();
|
| file_util::Delete(path_, true);
|
| }
|
|
|
| @@ -192,6 +193,21 @@
|
| 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 @@
|
| ProfileSyncService* TestingProfile::GetProfileSyncService() {
|
| return profile_sync_service_.get();
|
| }
|
| +
|
| +void TestingProfile::DestroyWebDataService() {
|
| + if (!web_data_service_.get())
|
| + return;
|
| +
|
| + web_data_service_->Shutdown();
|
| +}
|
|
|