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

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

Issue 10875064: Rename SyncNotifier->Invalidator and SyncNotifierObserver->InvalidationHandler. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to ToT for landing Created 8 years, 4 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/chrome_sync_notification_bridge_unittest.cc
diff --git a/chrome/browser/sync/glue/chrome_sync_notification_bridge_unittest.cc b/chrome/browser/sync/glue/chrome_sync_notification_bridge_unittest.cc
index e410903a175c6d9debe6411e7b238593121d9b9d..1769b7e116c260636a07177d7a100b4a03180a2a 100644
--- a/chrome/browser/sync/glue/chrome_sync_notification_bridge_unittest.cc
+++ b/chrome/browser/sync/glue/chrome_sync_notification_bridge_unittest.cc
@@ -22,8 +22,8 @@
#include "content/public/test/test_browser_thread.h"
#include "sync/internal_api/public/base/model_type.h"
#include "sync/internal_api/public/base/model_type_state_map.h"
+#include "sync/notifier/invalidation_handler.h"
#include "sync/notifier/object_id_state_map_test_util.h"
-#include "sync/notifier/sync_notifier_observer.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -42,9 +42,9 @@ using content::BrowserThread;
// Note: Because this object lives on the sync thread, we use a fake
// (vs a mock) so we don't have to worry about possible thread safety
// issues within GTest/GMock.
-class FakeSyncNotifierObserver : public syncer::SyncNotifierObserver {
+class FakeInvalidationHandler : public syncer::InvalidationHandler {
public:
- FakeSyncNotifierObserver(
+ FakeInvalidationHandler(
const scoped_refptr<base::SequencedTaskRunner>& sync_task_runner,
ChromeSyncNotificationBridge* bridge,
const syncer::ObjectIdStateMap& expected_states,
@@ -62,12 +62,12 @@ class FakeSyncNotifierObserver : public syncer::SyncNotifierObserver {
bridge_->UpdateRegisteredIds(this, ids);
}
- virtual ~FakeSyncNotifierObserver() {
+ virtual ~FakeInvalidationHandler() {
DCHECK(sync_task_runner_->RunsTasksOnCurrentThread());
bridge_->UnregisterHandler(this);
}
- // SyncNotifierObserver implementation.
+ // InvalidationHandler implementation.
virtual void OnIncomingNotification(
const syncer::ObjectIdStateMap& id_state_map,
syncer::IncomingNotificationSource source) OVERRIDE {
@@ -109,8 +109,8 @@ class ChromeSyncNotificationBridgeTest : public testing::Test {
ChromeSyncNotificationBridgeTest()
: ui_thread_(BrowserThread::UI),
sync_thread_("Sync thread"),
- sync_observer_(NULL),
- sync_observer_notification_failure_(false),
+ sync_handler_(NULL),
+ sync_handler_notification_failure_(false),
done_(true, false) {}
virtual ~ChromeSyncNotificationBridgeTest() {}
@@ -128,8 +128,8 @@ class ChromeSyncNotificationBridgeTest : public testing::Test {
sync_thread_.Stop();
// Must be reset only after the sync thread is stopped.
bridge_.reset();
- EXPECT_EQ(NULL, sync_observer_);
- if (sync_observer_notification_failure_)
+ EXPECT_EQ(NULL, sync_handler_);
+ if (sync_handler_notification_failure_)
ADD_FAILURE() << "Sync Observer did not receive proper notification.";
}
@@ -180,13 +180,13 @@ class ChromeSyncNotificationBridgeTest : public testing::Test {
private:
void VerifyAndDestroyObserverOnSyncThread() {
DCHECK(sync_thread_.message_loop_proxy()->RunsTasksOnCurrentThread());
- if (!sync_observer_) {
- sync_observer_notification_failure_ = true;
+ if (!sync_handler_) {
+ sync_handler_notification_failure_ = true;
} else {
- sync_observer_notification_failure_ =
- !sync_observer_->ReceivedProperNotification();
- delete sync_observer_;
- sync_observer_ = NULL;
+ sync_handler_notification_failure_ =
+ !sync_handler_->ReceivedProperNotification();
+ delete sync_handler_;
+ sync_handler_ = NULL;
}
}
@@ -194,7 +194,7 @@ class ChromeSyncNotificationBridgeTest : public testing::Test {
const syncer::ObjectIdStateMap& expected_states,
syncer::IncomingNotificationSource expected_source) {
DCHECK(sync_thread_.message_loop_proxy()->RunsTasksOnCurrentThread());
- sync_observer_ = new FakeSyncNotifierObserver(
+ sync_handler_ = new FakeInvalidationHandler(
sync_thread_.message_loop_proxy(),
bridge_.get(),
expected_states,
@@ -227,8 +227,8 @@ class ChromeSyncNotificationBridgeTest : public testing::Test {
base::Thread sync_thread_;
NiceMock<ProfileMock> mock_profile_;
// Created/used/destroyed on sync thread.
- FakeSyncNotifierObserver* sync_observer_;
- bool sync_observer_notification_failure_;
+ FakeInvalidationHandler* sync_handler_;
+ bool sync_handler_notification_failure_;
scoped_ptr<ChromeSyncNotificationBridge> bridge_;
base::WaitableEvent done_;
};
« no previous file with comments | « chrome/browser/sync/glue/chrome_sync_notification_bridge.cc ('k') | chrome/browser/sync/glue/sync_backend_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698