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

Unified Diff: chrome/browser/notifications/extension_welcome_notification_unittest.cc

Issue 151963002: Remove duplicated code from sync related unit tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed a const qualifier. Created 6 years, 10 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/notifications/extension_welcome_notification_unittest.cc
diff --git a/chrome/browser/notifications/extension_welcome_notification_unittest.cc b/chrome/browser/notifications/extension_welcome_notification_unittest.cc
index 6b251a4d6613002bfa4f1cb41a224d35e43627d6..5f7788bb4ae434f1f91a9c8f3eab933a5d0e8bcc 100644
--- a/chrome/browser/notifications/extension_welcome_notification_unittest.cc
+++ b/chrome/browser/notifications/extension_welcome_notification_unittest.cc
@@ -17,6 +17,7 @@
#include "chrome/test/base/testing_pref_service_syncable.h"
#include "chrome/test/base/testing_profile.h"
#include "components/user_prefs/pref_registry_syncable.h"
+#include "sync/api/fake_sync_change_processor.h"
#include "sync/api/sync_error_factory_mock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/message_center/fake_message_center.h"
@@ -122,25 +123,6 @@ public:
DISALLOW_COPY_AND_ASSIGN(WelcomeNotificationDelegate);
};
-class TestSyncProcessor : public syncer::SyncChangeProcessor {
- public:
- TestSyncProcessor() {}
-
- virtual syncer::SyncError ProcessSyncChanges(
- const tracked_objects::Location& from_here,
- const syncer::SyncChangeList& change_list) OVERRIDE {
- return syncer::SyncError();
- }
-
- virtual syncer::SyncDataList GetAllSyncData(syncer::ModelType type)
- const OVERRIDE {
- return syncer::SyncDataList();
- }
-
- private:
- DISALLOW_COPY_AND_ASSIGN(TestSyncProcessor);
-};
-
class ExtensionWelcomeNotificationTest : public testing::Test {
protected:
ExtensionWelcomeNotificationTest() {
@@ -170,12 +152,12 @@ class ExtensionWelcomeNotificationTest : public testing::Test {
void StartPreferenceSyncing() const {
PrefServiceSyncable::FromProfile(profile_.get())
->GetSyncableService(syncer::PREFERENCES)
- ->MergeDataAndStartSyncing(
- syncer::PREFERENCES,
- syncer::SyncDataList(),
- scoped_ptr<syncer::SyncChangeProcessor>(new TestSyncProcessor),
- scoped_ptr<syncer::SyncErrorFactory>(
- new syncer::SyncErrorFactoryMock()));
+ ->MergeDataAndStartSyncing(syncer::PREFERENCES,
+ syncer::SyncDataList(),
+ scoped_ptr<syncer::SyncChangeProcessor>(
+ new syncer::FakeSyncChangeProcessor),
+ scoped_ptr<syncer::SyncErrorFactory>(
+ new syncer::SyncErrorFactoryMock()));
}
void ShowChromeNowNotification() const {

Powered by Google App Engine
This is Rietveld 408576698