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

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

Issue 12851008: Create a common base class for all the webdatas (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to committed parent and head. 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 f6846a972bb1c242ffe4b436c352353f7c5e9252..b6cac6a3e1f0578590075cf2b18709132cc64d8d 100644
--- a/chrome/browser/sync/glue/autofill_data_type_controller_unittest.cc
+++ b/chrome/browser/sync/glue/autofill_data_type_controller_unittest.cc
@@ -17,6 +17,7 @@
#include "chrome/browser/webdata/autocomplete_syncable_service.h"
#include "chrome/browser/webdata/web_data_service.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"
#include "chrome/test/base/profile_mock.h"
#include "content/public/browser/notification_service.h"
@@ -125,31 +126,23 @@ class FakeWebDataService : public WebDataService {
DISALLOW_COPY_AND_ASSIGN(FakeWebDataService);
};
-class MockWebDataServiceWrapper : public WebDataServiceWrapper {
+class MockWebDataServiceWrapperSyncable : public MockWebDataServiceWrapper {
public:
static ProfileKeyedService* Build(Profile* profile) {
- return new MockWebDataServiceWrapper();
+ return new MockWebDataServiceWrapperSyncable();
}
- MockWebDataServiceWrapper() {
- fake_web_data_service_ = new FakeWebDataService();
+ MockWebDataServiceWrapperSyncable()
+ : MockWebDataServiceWrapper(new FakeWebDataService()) {
}
void Shutdown() OVERRIDE {
- fake_web_data_service_->ShutdownSyncableService();
- }
-
- scoped_refptr<WebDataService> GetWebData() OVERRIDE {
- return fake_web_data_service_;
- }
-
- ~MockWebDataServiceWrapper() {
- fake_web_data_service_ = NULL;
+ static_cast<FakeWebDataService*>(
+ fake_web_data_service_.get())->ShutdownSyncableService();
}
private:
- scoped_refptr<FakeWebDataService> fake_web_data_service_;
-
+ DISALLOW_COPY_AND_ASSIGN(MockWebDataServiceWrapperSyncable);
};
class SyncAutofillDataTypeControllerTest : public testing::Test {
@@ -170,7 +163,7 @@ class SyncAutofillDataTypeControllerTest : public testing::Test {
WillRepeatedly(Return(change_processor_.get()));
WebDataServiceFactory::GetInstance()->SetTestingFactory(
- &profile_, MockWebDataServiceWrapper::Build);
+ &profile_, MockWebDataServiceWrapperSyncable::Build);
autofill_dtc_ =
new AutofillDataTypeController(&profile_sync_factory_,
« no previous file with comments | « chrome/browser/api/webdata/web_data_service_base.h ('k') | chrome/browser/sync/profile_sync_service_autofill_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698