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

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

Issue 12695015: Split Autofill webdata (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Convert all Autofill/Sync clients of WDS to using AutofillWDS 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 8d86afae9c0936ee09139f31a2dafba7d450e965..e6b65e677b94b6f8559441ba248589fabea9b654 100644
--- a/chrome/browser/sync/glue/autofill_data_type_controller_unittest.cc
+++ b/chrome/browser/sync/glue/autofill_data_type_controller_unittest.cc
@@ -16,7 +16,7 @@
#include "chrome/browser/sync/profile_sync_service_factory.h"
#include "chrome/browser/sync/profile_sync_service_mock.h"
#include "chrome/browser/webdata/autocomplete_syncable_service.h"
-#include "chrome/browser/webdata/web_data_service.h"
+#include "chrome/browser/webdata/autofill_web_data_service_impl.h"
#include "chrome/browser/webdata/web_data_service_factory.h"
#include "chrome/browser/webdata/web_data_service_test_util.h"
#include "chrome/common/chrome_notification_types.h"
@@ -40,10 +40,12 @@ using testing::Return;
// Fake WebDataService implementation that stubs out the database
// loading.
-class FakeWebDataService : public WebDataService {
+class FakeWebDataService : public AutofillWebDataServiceImpl {
public:
FakeWebDataService()
- : is_database_loaded_(false) {}
+ : AutofillWebDataServiceImpl(
+ NULL, WebDataServiceBase::ProfileErrorCallback()),
+ is_database_loaded_(false) {}
// Mark the database as loaded and send out the appropriate
// notification.
@@ -54,7 +56,7 @@ class FakeWebDataService : public WebDataService {
// use that instead of sending this notification manually.
content::NotificationService::current()->Notify(
chrome::NOTIFICATION_WEB_DATABASE_LOADED,
- content::Source<WebDataService>(this),
+ content::Source<AutofillWebDataService>(this),
content::NotificationService::NoDetails());
}
@@ -82,9 +84,6 @@ class FakeWebDataService : public WebDataService {
run_loop.Run();
}
- void ShutdownSyncableService() {
- }
-
void GetAutofillCullingValue(bool* result) {
ASSERT_TRUE(BrowserThread::CurrentlyOn(BrowserThread::DB));
*result = AutocompleteSyncableService::FromWebDataService(
@@ -103,7 +102,7 @@ class FakeWebDataService : public WebDataService {
private:
virtual ~FakeWebDataService() {
- DCHECK(!AutocompleteSyncableService::FromWebDataService(this));
+ //DCHECK(!AutocompleteSyncableService::FromWebDataService(this));
Jói 2013/03/20 23:09:10 FYI, this line is removed in the latest version of
Cait (Slow) 2013/03/21 23:23:27 Done.
}
void CreateSyncableService() {
@@ -124,12 +123,12 @@ class MockWebDataServiceWrapperSyncable : public MockWebDataServiceWrapper {
}
MockWebDataServiceWrapperSyncable()
- : MockWebDataServiceWrapper(new FakeWebDataService()) {
+ : MockWebDataServiceWrapper(NULL, new FakeWebDataService()) {
}
void Shutdown() OVERRIDE {
static_cast<FakeWebDataService*>(
- fake_web_data_service_.get())->ShutdownSyncableService();
+ fake_autofill_web_data_.get())->ShutdownOnUIThread();
}
private:
@@ -212,7 +211,7 @@ class SyncAutofillDataTypeControllerTest : public testing::Test {
TEST_F(SyncAutofillDataTypeControllerTest, StartWDSReady) {
FakeWebDataService* web_db =
static_cast<FakeWebDataService*>(
- WebDataService::FromBrowserContext(&profile_).get());
+ AutofillWebDataService::FromBrowserContext(&profile_).get());
web_db->LoadDatabase();
autofill_dtc_->LoadModels(
base::Bind(&SyncAutofillDataTypeControllerTest::OnLoadFinished,
@@ -245,7 +244,7 @@ TEST_F(SyncAutofillDataTypeControllerTest, StartWDSNotReady) {
FakeWebDataService* web_db =
static_cast<FakeWebDataService*>(
- WebDataService::FromBrowserContext(&profile_).get());
+ AutofillWebDataService::FromBrowserContext(&profile_).get());
web_db->LoadDatabase();
EXPECT_CALL(*change_processor_, Connect(_,_,_,_,_))
@@ -264,7 +263,7 @@ TEST_F(SyncAutofillDataTypeControllerTest, StartWDSNotReady) {
TEST_F(SyncAutofillDataTypeControllerTest, UpdateAutofillCullingSettings) {
FakeWebDataService* web_db =
static_cast<FakeWebDataService*>(
- WebDataService::FromBrowserContext(&profile_).get());
+ AutofillWebDataService::FromBrowserContext(&profile_).get());
// Set up the experiments state.
ProfileSyncService* sync = ProfileSyncServiceFactory::GetForProfile(

Powered by Google App Engine
This is Rietveld 408576698