Index: sync/notifier/non_blocking_invalidator_unittest.cc |
diff --git a/sync/notifier/non_blocking_invalidation_notifier_unittest.cc b/sync/notifier/non_blocking_invalidator_unittest.cc |
similarity index 75% |
rename from sync/notifier/non_blocking_invalidation_notifier_unittest.cc |
rename to sync/notifier/non_blocking_invalidator_unittest.cc |
index a749b64971e94f3df5daf45efd9f9cc4cece5ecc..8704cd2cc7f1268bffa10050a9a10032b690a3e4 100644 |
--- a/sync/notifier/non_blocking_invalidation_notifier_unittest.cc |
+++ b/sync/notifier/non_blocking_invalidator_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/non_blocking_invalidation_notifier.h" |
+#include "sync/notifier/non_blocking_invalidator.h" |
#include "base/memory/ref_counted.h" |
#include "base/memory/scoped_ptr.h" |
@@ -14,7 +14,7 @@ |
#include "sync/internal_api/public/base/model_type.h" |
#include "sync/internal_api/public/base/model_type_state_map.h" |
#include "sync/internal_api/public/util/weak_handle.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/object_id_state_map_test_util.h" |
#include "testing/gmock/include/gmock/gmock.h" |
@@ -27,9 +27,9 @@ namespace { |
using ::testing::InSequence; |
using ::testing::StrictMock; |
-class NonBlockingInvalidationNotifierTest : public testing::Test { |
+class NonBlockingInvalidatorTest : public testing::Test { |
public: |
- NonBlockingInvalidationNotifierTest() : io_thread_("Test IO thread") {} |
+ NonBlockingInvalidatorTest() : io_thread_("Test IO thread") {} |
protected: |
virtual void SetUp() { |
@@ -41,17 +41,17 @@ class NonBlockingInvalidationNotifierTest : public testing::Test { |
notifier::NotifierOptions notifier_options; |
notifier_options.request_context_getter = request_context_getter_; |
invalidation_notifier_.reset( |
- new NonBlockingInvalidationNotifier( |
+ new NonBlockingInvalidator( |
notifier_options, |
InvalidationVersionMap(), |
std::string(), // initial_invalidation_state |
MakeWeakHandle(base::WeakPtr<InvalidationStateTracker>()), |
"fake_client_info")); |
- invalidation_notifier_->RegisterHandler(&fake_observer_); |
+ invalidation_notifier_->RegisterHandler(&fake_handler_); |
} |
virtual void TearDown() { |
- invalidation_notifier_->UnregisterHandler(&fake_observer_); |
+ invalidation_notifier_->UnregisterHandler(&fake_handler_); |
invalidation_notifier_.reset(); |
request_context_getter_ = NULL; |
io_thread_.Stop(); |
@@ -61,21 +61,21 @@ class NonBlockingInvalidationNotifierTest : public testing::Test { |
MessageLoop ui_loop_; |
base::Thread io_thread_; |
scoped_refptr<net::URLRequestContextGetter> request_context_getter_; |
- scoped_ptr<NonBlockingInvalidationNotifier> invalidation_notifier_; |
- FakeSyncNotifierObserver fake_observer_; |
+ scoped_ptr<NonBlockingInvalidator> invalidation_notifier_; |
+ FakeInvalidationHandler fake_handler_; |
notifier::FakeBaseTask fake_base_task_; |
}; |
// TODO(akalin): Add real unit tests (http://crbug.com/140410). |
-TEST_F(NonBlockingInvalidationNotifierTest, Basic) { |
+TEST_F(NonBlockingInvalidatorTest, Basic) { |
const ModelTypeSet models(PREFERENCES, BOOKMARKS, AUTOFILL); |
const ObjectIdStateMap& id_state_map = |
ModelTypeStateMapToObjectIdStateMap( |
ModelTypeSetToStateMap(models, "payload")); |
invalidation_notifier_->UpdateRegisteredIds( |
- &fake_observer_, ModelTypeSetToObjectIdSet(models)); |
+ &fake_handler_, ModelTypeSetToObjectIdSet(models)); |
invalidation_notifier_->SetStateDeprecated("fake_state"); |
invalidation_notifier_->SetUniqueId("fake_id"); |
@@ -83,23 +83,23 @@ TEST_F(NonBlockingInvalidationNotifierTest, Basic) { |
invalidation_notifier_->OnNotificationsEnabled(); |
EXPECT_EQ(NO_NOTIFICATION_ERROR, |
- fake_observer_.GetNotificationsDisabledReason()); |
+ fake_handler_.GetNotificationsDisabledReason()); |
invalidation_notifier_->OnIncomingNotification( |
id_state_map, REMOTE_NOTIFICATION); |
EXPECT_THAT(id_state_map, |
- Eq(fake_observer_.GetLastNotificationIdStateMap())); |
- EXPECT_EQ(REMOTE_NOTIFICATION, fake_observer_.GetLastNotificationSource()); |
+ Eq(fake_handler_.GetLastNotificationIdStateMap())); |
+ EXPECT_EQ(REMOTE_NOTIFICATION, fake_handler_.GetLastNotificationSource()); |
invalidation_notifier_->OnNotificationsDisabled( |
TRANSIENT_NOTIFICATION_ERROR); |
EXPECT_EQ(TRANSIENT_NOTIFICATION_ERROR, |
- fake_observer_.GetNotificationsDisabledReason()); |
+ fake_handler_.GetNotificationsDisabledReason()); |
invalidation_notifier_->OnNotificationsDisabled( |
NOTIFICATION_CREDENTIALS_REJECTED); |
EXPECT_EQ(NOTIFICATION_CREDENTIALS_REJECTED, |
- fake_observer_.GetNotificationsDisabledReason()); |
+ fake_handler_.GetNotificationsDisabledReason()); |
ui_loop_.RunAllPending(); |
} |