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

Unified Diff: chrome/browser/notifications/sync_notifier/chrome_notifier_service_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: Rename SyncChangeProcessorDelgate to SyncChangeProcessorDelgator. Created 6 years, 11 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/sync_notifier/chrome_notifier_service_unittest.cc
diff --git a/chrome/browser/notifications/sync_notifier/chrome_notifier_service_unittest.cc b/chrome/browser/notifications/sync_notifier/chrome_notifier_service_unittest.cc
index 5dddca5be2f4328cdcb018122fbe1b4c99d3cf87..7cb36181caaed6f6062e4cb4b2ec57ef3c50c3c1 100644
--- a/chrome/browser/notifications/sync_notifier/chrome_notifier_service_unittest.cc
+++ b/chrome/browser/notifications/sync_notifier/chrome_notifier_service_unittest.cc
@@ -24,6 +24,7 @@
#include "content/public/test/test_browser_thread_bundle.h"
#include "sync/api/sync_change.h"
#include "sync/api/sync_change_processor.h"
+#include "sync/api/sync_change_processor_delegator.h"
#include "sync/api/sync_error_factory.h"
#include "sync/api/sync_error_factory_mock.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -34,6 +35,7 @@ using sync_pb::EntitySpecifics;
using syncer::SyncData;
using syncer::SyncChange;
using syncer::SyncChangeList;
+using syncer::SyncChangeProcessorDelegator;
using syncer::SyncDataList;
using syncer::SYNCED_NOTIFICATIONS;
using notifier::SyncedNotification;
@@ -97,38 +99,11 @@ class TestChangeProcessor : public syncer::SyncChangeProcessor {
DISALLOW_COPY_AND_ASSIGN(TestChangeProcessor);
};
-class SyncChangeProcessorDelegate : public syncer::SyncChangeProcessor {
- public:
- explicit SyncChangeProcessorDelegate(SyncChangeProcessor* recipient)
- : recipient_(recipient) {
- EXPECT_TRUE(recipient_);
- }
- virtual ~SyncChangeProcessorDelegate() {}
-
- // syncer::SyncChangeProcessor implementation.
- virtual syncer::SyncError ProcessSyncChanges(
- const tracked_objects::Location& from_here,
- const SyncChangeList& change_list) OVERRIDE {
- return recipient_->ProcessSyncChanges(from_here, change_list);
- }
-
- virtual syncer::SyncDataList GetAllSyncData(syncer::ModelType type) const
- OVERRIDE {
- return recipient_->GetAllSyncData(type);
- }
-
- private:
- // The recipient of all sync changes.
- SyncChangeProcessor* recipient_;
-
- DISALLOW_COPY_AND_ASSIGN(SyncChangeProcessorDelegate);
-};
-
class ChromeNotifierServiceTest : public testing::Test {
public:
ChromeNotifierServiceTest()
: sync_processor_(new TestChangeProcessor),
- sync_processor_delegate_(new SyncChangeProcessorDelegate(
+ sync_processor_delegate_(new SyncChangeProcessorDelegator(
sync_processor_.get())) {}
virtual ~ChromeNotifierServiceTest() {}

Powered by Google App Engine
This is Rietveld 408576698