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

Unified Diff: components/autofill/core/browser/personal_data_manager_unittest.cc

Issue 560093002: PersonalDataManagerTest should delete temporary directory AFTER WebDataServiceBackend stops using i… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/core/browser/personal_data_manager_unittest.cc
diff --git a/components/autofill/core/browser/personal_data_manager_unittest.cc b/components/autofill/core/browser/personal_data_manager_unittest.cc
index 20e10f2499008e3f76582e611306008cd1ef1997..373dc190d825356f5d50dded4ea0b82c0d41c3dd 100644
--- a/components/autofill/core/browser/personal_data_manager_unittest.cc
+++ b/components/autofill/core/browser/personal_data_manager_unittest.cc
@@ -83,16 +83,6 @@ class PersonalDataManagerTest : public testing::Test {
ResetPersonalDataManager(USER_MODE_NORMAL);
}
- virtual void TearDown() {
- // Destruction order is imposed explicitly here.
- personal_data_.reset(NULL);
-
- autofill_database_service_->ShutdownOnUIThread();
- web_database_->ShutdownDatabase();
- autofill_database_service_ = NULL;
- web_database_ = NULL;
- }
-
void ResetPersonalDataManager(UserMode user_mode) {
bool is_incognito = (user_mode == USER_MODE_INCOGNITO);
personal_data_.reset(new PersonalDataManager("en-US"));
@@ -108,13 +98,15 @@ class PersonalDataManagerTest : public testing::Test {
base::MessageLoop::current()->Run();
}
+ // The temporary directory should be deleted at the end to ensure that
+ // files are not used anymore and deletion succeeds.
+ base::ScopedTempDir temp_dir_;
base::MessageLoopForUI message_loop_;
scoped_ptr<PrefService> prefs_;
scoped_refptr<AutofillWebDataService> autofill_database_service_;
scoped_refptr<WebDatabaseService> web_database_;
- base::ScopedTempDir temp_dir_;
- scoped_ptr<PersonalDataManager> personal_data_;
PersonalDataLoadedObserverMock personal_data_observer_;
+ scoped_ptr<PersonalDataManager> personal_data_;
};
TEST_F(PersonalDataManagerTest, AddProfile) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698