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

Unified Diff: chrome/browser/sync/glue/autofill_data_type_controller_unittest.cc

Issue 12494020: Remove knowledge of Chrome-specific SyncableService classes from WebDataService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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
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

Powered by Google App Engine
This is Rietveld 408576698