summaryrefslogtreecommitdiffstats
path: root/chrome/test/testing_profile.cc
diff options
context:
space:
mode:
authorjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-24 08:32:55 +0000
committerjhawkins@chromium.org <jhawkins@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-24 08:32:55 +0000
commit2609bc107a31083c6c88e207d13eaa029d594235 (patch)
tree8331e468eb82a2a9611f388349da4f3565ee3201 /chrome/test/testing_profile.cc
parent51552aae65a96d19e1adcbf6fe760f102b53a8bf (diff)
downloadchromium_src-2609bc107a31083c6c88e207d13eaa029d594235.zip
chromium_src-2609bc107a31083c6c88e207d13eaa029d594235.tar.gz
chromium_src-2609bc107a31083c6c88e207d13eaa029d594235.tar.bz2
Add the ability to save and remove AutoFill profiles from the AutoFillDialog.
BUG=18201 TEST=PersonalDataManagerTest.SetProfiles Review URL: http://codereview.chromium.org/545175 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36978 0039d316-1c4b-4281-b951-d872f2087c98
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();
+}