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

Unified Diff: sync/notifier/invalidator_factory_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
« no previous file with comments | « sync/notifier/invalidator_factory.cc ('k') | sync/notifier/invalidator_registrar.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/notifier/invalidator_factory_unittest.cc
diff --git a/sync/notifier/sync_notifier_factory_unittest.cc b/sync/notifier/invalidator_factory_unittest.cc
similarity index 63%
rename from sync/notifier/sync_notifier_factory_unittest.cc
rename to sync/notifier/invalidator_factory_unittest.cc
index 6e2bc58b99fc62023b5f0d20da01fecd7998211d..2b17e356f35fbdc94033f21725f0356b5ce9772b 100644
--- a/sync/notifier/sync_notifier_factory_unittest.cc
+++ b/sync/notifier/invalidator_factory_unittest.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "sync/notifier/sync_notifier_factory.h"
+#include "sync/notifier/invalidator_factory.h"
#include "base/command_line.h"
#include "base/compiler_specific.h"
@@ -15,15 +15,15 @@
#include "jingle/notifier/base/notifier_options.h"
#include "net/url_request/url_request_test_util.h"
#include "sync/internal_api/public/base/model_type.h"
-#include "sync/notifier/fake_sync_notifier_observer.h"
+#include "sync/notifier/fake_invalidation_handler.h"
#include "sync/notifier/invalidation_state_tracker.h"
-#include "sync/notifier/sync_notifier.h"
+#include "sync/notifier/invalidator.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace syncer {
namespace {
-class SyncNotifierFactoryTest : public testing::Test {
+class InvalidatorFactoryTest : public testing::Test {
protected:
virtual void SetUp() OVERRIDE {
@@ -33,50 +33,50 @@ class SyncNotifierFactoryTest : public testing::Test {
virtual void TearDown() OVERRIDE {
message_loop_.RunAllPending();
- EXPECT_EQ(0, fake_observer_.GetNotificationCount());
+ EXPECT_EQ(0, fake_handler_.GetNotificationCount());
}
MessageLoop message_loop_;
- FakeSyncNotifierObserver fake_observer_;
+ FakeInvalidationHandler fake_handler_;
notifier::NotifierOptions notifier_options_;
- scoped_ptr<SyncNotifierFactory> factory_;
+ scoped_ptr<InvalidatorFactory> factory_;
};
// Test basic creation of a NonBlockingInvalidationNotifier.
-TEST_F(SyncNotifierFactoryTest, Basic) {
+TEST_F(InvalidatorFactoryTest, Basic) {
notifier_options_.notification_method = notifier::NOTIFICATION_SERVER;
- SyncNotifierFactory factory(
+ InvalidatorFactory factory(
notifier_options_,
"test client info",
base::WeakPtr<InvalidationStateTracker>());
- scoped_ptr<SyncNotifier> notifier(factory.CreateSyncNotifier());
+ scoped_ptr<Invalidator> invalidator(factory.CreateInvalidator());
#if defined(OS_ANDROID)
- ASSERT_FALSE(notifier.get());
+ ASSERT_FALSE(invalidator.get());
#else
- ASSERT_TRUE(notifier.get());
+ ASSERT_TRUE(invalidator.get());
ObjectIdSet ids = ModelTypeSetToObjectIdSet(ModelTypeSet(syncer::BOOKMARKS));
- notifier->RegisterHandler(&fake_observer_);
- notifier->UpdateRegisteredIds(&fake_observer_, ids);
- notifier->UnregisterHandler(&fake_observer_);
+ invalidator->RegisterHandler(&fake_handler_);
+ invalidator->UpdateRegisteredIds(&fake_handler_, ids);
+ invalidator->UnregisterHandler(&fake_handler_);
#endif
}
// Test basic creation of a P2PNotifier.
-TEST_F(SyncNotifierFactoryTest, Basic_P2P) {
+TEST_F(InvalidatorFactoryTest, Basic_P2P) {
notifier_options_.notification_method = notifier::NOTIFICATION_P2P;
- SyncNotifierFactory factory(
+ InvalidatorFactory factory(
notifier_options_,
"test client info",
base::WeakPtr<InvalidationStateTracker>());
- scoped_ptr<SyncNotifier> notifier(factory.CreateSyncNotifier());
+ scoped_ptr<Invalidator> invalidator(factory.CreateInvalidator());
#if defined(OS_ANDROID)
- ASSERT_FALSE(notifier.get());
+ ASSERT_FALSE(invalidator.get());
#else
- ASSERT_TRUE(notifier.get());
+ ASSERT_TRUE(invalidator.get());
ObjectIdSet ids = ModelTypeSetToObjectIdSet(ModelTypeSet(syncer::BOOKMARKS));
- notifier->RegisterHandler(&fake_observer_);
- notifier->UpdateRegisteredIds(&fake_observer_, ids);
- notifier->UnregisterHandler(&fake_observer_);
+ invalidator->RegisterHandler(&fake_handler_);
+ invalidator->UpdateRegisteredIds(&fake_handler_, ids);
+ invalidator->UnregisterHandler(&fake_handler_);
#endif
}
« no previous file with comments | « sync/notifier/invalidator_factory.cc ('k') | sync/notifier/invalidator_registrar.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698