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

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

Issue 12957002: wd4-ui for try only (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: wd4-ui_with_windows_fix 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 1609a9f4d188b891c3538a5463957dcd9a983d97..502fabba28f5066d4a0329c2505ef3e7a381d517 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"
@@ -40,7 +41,8 @@ using testing::Return;
// loading.
class FakeWebDataService : public WebDataService {
public:
- FakeWebDataService() : is_database_loaded_(false) {}
+ FakeWebDataService()
+ : is_database_loaded_(false) {}
// Mark the database as loaded and send out the appropriate
// notification.
@@ -59,10 +61,6 @@ class FakeWebDataService : public WebDataService {
return is_database_loaded_;
}
- virtual void ShutdownOnUIThread() OVERRIDE {
- ShutdownSyncableService();
- }
-
virtual AutocompleteSyncableService*
GetAutocompleteSyncableService() const OVERRIDE {
return autocomplete_syncable_service_;
@@ -129,6 +127,25 @@ class FakeWebDataService : public WebDataService {
DISALLOW_COPY_AND_ASSIGN(FakeWebDataService);
};
+class MockWebDataServiceWrapperSyncable : public MockWebDataServiceWrapper {
+ public:
+ static ProfileKeyedService* Build(Profile* profile) {
+ return new MockWebDataServiceWrapperSyncable();
+ }
+
+ MockWebDataServiceWrapperSyncable()
+ : MockWebDataServiceWrapper(new FakeWebDataService()) {
+ }
+
+ void Shutdown() OVERRIDE {
+ static_cast<FakeWebDataService*>(
+ fake_web_data_service_.get())->ShutdownSyncableService();
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(MockWebDataServiceWrapperSyncable);
+};
+
class SyncAutofillDataTypeControllerTest : public testing::Test {
public:
SyncAutofillDataTypeControllerTest()
@@ -147,7 +164,7 @@ class SyncAutofillDataTypeControllerTest : public testing::Test {
WillRepeatedly(Return(change_processor_.get()));
WebDataServiceFactory::GetInstance()->SetTestingFactory(
- &profile_, BuildWebDataService);
+ &profile_, MockWebDataServiceWrapperSyncable::Build);
autofill_dtc_ =
new AutofillDataTypeController(&profile_sync_factory_,
@@ -175,11 +192,6 @@ class SyncAutofillDataTypeControllerTest : public testing::Test {
change_processor_ = NULL;
}
- static scoped_refptr<RefcountedProfileKeyedService>
- BuildWebDataService(Profile* profile) {
- return new FakeWebDataService();
- }
-
void BlockForDBThread() {
base::RunLoop run_loop;
ASSERT_TRUE(BrowserThread::PostTaskAndReply(BrowserThread::DB, FROM_HERE,
« no previous file with comments | « chrome/browser/profiles/profile_browsertest.cc ('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