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

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

Issue 14081043: Hook up Autofill Backend interface to SyncableServices (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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 6d724a79b2969d8f1a0674756a4f2e995958c2a7..5e32adc1b734020f48fad7b58d35a96520e72ef9 100644
--- a/chrome/browser/sync/glue/autofill_data_type_controller_unittest.cc
+++ b/chrome/browser/sync/glue/autofill_data_type_controller_unittest.cc
@@ -19,6 +19,7 @@
#include "chrome/browser/webdata/web_data_service_factory.h"
#include "chrome/common/chrome_notification_types.h"
#include "chrome/test/base/profile_mock.h"
+#include "components/autofill/browser/webdata/autofill_backend_delegate.h"
#include "components/autofill/browser/webdata/autofill_webdata_service.h"
#include "components/webdata/common/web_data_service_test_util.h"
#include "components/webdata/common/web_database_observer.h"
@@ -88,6 +89,11 @@ class FakeWebDataService : public AutofillWebDataService {
observer_ = NULL;
}
+ virtual void ShutdownOnDBThread() OVERRIDE {
+ AutofillWebDataService::ShutdownOnDBThread();
+ delegate_.reset();
+ }
+
void StartSyncableService() {
// The |autofill_profile_syncable_service_| must be constructed on the DB
// thread.
@@ -121,11 +127,15 @@ class FakeWebDataService : public AutofillWebDataService {
void CreateSyncableService() {
ASSERT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::DB));
// These services are deleted in DestroySyncableService().
- AutocompleteSyncableService::CreateForWebDataService(this);
+ delegate_.reset(new autofill::AutofillBackendDelegate(
+ base::WeakPtr<WebDatabase>(),
+ base::WeakPtr<autofill::AutofillWebDataBackend>()));
+ AutocompleteSyncableService::CreateForWebDataService(this, delegate_.get());
}
bool is_database_loaded_;
+ scoped_ptr<autofill::AutofillBackendDelegate> delegate_;
WebDatabaseObserver* observer_;
DISALLOW_COPY_AND_ASSIGN(FakeWebDataService);

Powered by Google App Engine
This is Rietveld 408576698