Index: chrome/browser/sync/glue/autofill_data_type_controller_unittest.cc |
diff --git a/chrome/browser/sync/glue/autofill_data_type_controller_unittest.cc b/chrome/browser/sync/glue/autofill_data_type_controller_unittest.cc |
index d34163211ff3d90ca624311b19210a621e25e542..e80639c334c49ba13116f745e92775bbf650fd2b 100644 |
--- a/chrome/browser/sync/glue/autofill_data_type_controller_unittest.cc |
+++ b/chrome/browser/sync/glue/autofill_data_type_controller_unittest.cc |
@@ -62,12 +62,14 @@ class FakeWebDataService : public WebDataService { |
} |
virtual void ShutdownOnUIThread() OVERRIDE { |
- ShutdownSyncableService(); |
- } |
- |
- virtual AutocompleteSyncableService* |
- GetAutocompleteSyncableService() const OVERRIDE { |
- return autocomplete_syncable_service_; |
+ // The storage for syncable services must be destructed on the DB |
+ // thread. |
+ base::RunLoop run_loop; |
+ BrowserThread::PostTaskAndReply(BrowserThread::DB, FROM_HERE, |
+ base::Bind(&FakeWebDataService::ShutdownOnDBThread, |
+ base::Unretained(this), run_loop.QuitClosure())); |
+ run_loop.Run(); |
+ autocomplete_syncable_service_ = NULL; |
} |
void StartSyncableService() { |
@@ -81,13 +83,6 @@ class FakeWebDataService : public WebDataService { |
} |
void ShutdownSyncableService() { |
- // The |autofill_profile_syncable_service_| must be destructed on the DB |
- // thread. |
- base::RunLoop run_loop; |
- BrowserThread::PostTaskAndReply(BrowserThread::DB, FROM_HERE, |
- base::Bind(&FakeWebDataService::DestroySyncableService, |
- base::Unretained(this)), run_loop.QuitClosure()); |
- run_loop.Run(); |
} |
void GetAutofillCullingValue(bool* result) { |
@@ -114,12 +109,8 @@ class FakeWebDataService : public WebDataService { |
ASSERT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::DB)); |
// These services are deleted in DestroySyncableService(). |
autocomplete_syncable_service_ = new AutocompleteSyncableService(this); |
- } |
- |
- void DestroySyncableService() { |
- ASSERT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::DB)); |
- delete autocomplete_syncable_service_; |
- autocomplete_syncable_service_ = NULL; |
+ AutocompleteSyncableService::AttachToWebData( |
+ make_scoped_ptr(autocomplete_syncable_service_), this); |
} |
// We own the syncable services, but don't use a |scoped_ptr| because the |