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 |
} |