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

Unified Diff: chrome/browser/sync/profile_sync_service_autofill_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/profile_sync_service_autofill_unittest.cc
diff --git a/chrome/browser/sync/profile_sync_service_autofill_unittest.cc b/chrome/browser/sync/profile_sync_service_autofill_unittest.cc
index 712e0fd8a674a4f98bcc0f4fbe64587a0a261926..c0b06e458b0dea7f7ea49c9f738092dbd2c4ed1f 100644
--- a/chrome/browser/sync/profile_sync_service_autofill_unittest.cc
+++ b/chrome/browser/sync/profile_sync_service_autofill_unittest.cc
@@ -193,22 +193,6 @@ class WebDataServiceFake : public WebDataService {
return 0;
}
- virtual AutocompleteSyncableService*
- GetAutocompleteSyncableService() const OVERRIDE {
- EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::DB));
- EXPECT_TRUE(autocomplete_syncable_service_);
-
- return autocomplete_syncable_service_;
- }
-
- virtual AutofillProfileSyncableService*
- GetAutofillProfileSyncableService() const OVERRIDE {
- EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::DB));
- EXPECT_TRUE(autofill_profile_syncable_service_);
-
- return autofill_profile_syncable_service_;
- }
-
virtual void ShutdownOnUIThread() OVERRIDE {}
private:
@@ -217,25 +201,21 @@ class WebDataServiceFake : public WebDataService {
void CreateSyncableService() {
ASSERT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::DB));
// These services are deleted in DestroySyncableService().
- autocomplete_syncable_service_ = new AutocompleteSyncableService(this);
- autofill_profile_syncable_service_ =
- new AutofillProfileSyncableService(this);
+ AutocompleteSyncableService::AttachToWebData(
+ make_scoped_ptr(new AutocompleteSyncableService(this)), this);
+ AutofillProfileSyncableService::AttachToWebData(
+ make_scoped_ptr(new AutofillProfileSyncableService(this)), this);
syncable_service_created_or_destroyed_.Signal();
}
void DestroySyncableService() {
ASSERT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::DB));
- delete autofill_profile_syncable_service_;
- delete autocomplete_syncable_service_;
+ WebDataServiceBase::ShutdownOnDBThread();
syncable_service_created_or_destroyed_.Signal();
}
WebDatabase* web_database_;
- // We own the syncable services, but don't use a |scoped_ptr| because the
- // lifetime must be managed on the DB thread.
- AutocompleteSyncableService* autocomplete_syncable_service_;
- AutofillProfileSyncableService* autofill_profile_syncable_service_;
WaitableEvent syncable_service_created_or_destroyed_;
};
@@ -269,7 +249,7 @@ ACTION_P(MakeAutocompleteSyncComponents, wds) {
EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::DB));
if (!BrowserThread::CurrentlyOn(BrowserThread::DB))
return base::WeakPtr<syncer::SyncableService>();
- return wds->GetAutocompleteSyncableService()->AsWeakPtr();
+ return AutocompleteSyncableService::FromWebData(wds)->AsWeakPtr();
}
ACTION_P(ReturnNewDataTypeManagerWithDebugListener, debug_listener) {
@@ -298,7 +278,7 @@ ACTION_P(MakeAutofillProfileSyncComponents, wds) {
EXPECT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::DB));
if (!BrowserThread::CurrentlyOn(BrowserThread::DB))
return base::WeakPtr<syncer::SyncableService>();;
- return wds->GetAutofillProfileSyncableService()->AsWeakPtr();
+ return AutofillProfileSyncableService::FromWebData(wds)->AsWeakPtr();
}
class AbstractAutofillFactory {

Powered by Google App Engine
This is Rietveld 408576698