Index: sync/notifier/sync_invalidation_client_unittest.cc |
diff --git a/sync/notifier/chrome_invalidation_client_unittest.cc b/sync/notifier/sync_invalidation_client_unittest.cc |
similarity index 93% |
rename from sync/notifier/chrome_invalidation_client_unittest.cc |
rename to sync/notifier/sync_invalidation_client_unittest.cc |
index a7c8f8afd8f296f2b129032f1ddf47c8142a0c34..12280bb791caeca6617aee55b4915f1c4c28b21d 100644 |
--- a/sync/notifier/chrome_invalidation_client_unittest.cc |
+++ b/sync/notifier/sync_invalidation_client_unittest.cc |
@@ -12,9 +12,9 @@ |
#include "google/cacheinvalidation/include/types.h" |
#include "jingle/notifier/listener/fake_push_client.h" |
#include "sync/internal_api/public/util/weak_handle.h" |
-#include "sync/notifier/chrome_invalidation_client.h" |
#include "sync/notifier/fake_invalidation_state_tracker.h" |
#include "sync/notifier/invalidation_util.h" |
+#include "sync/notifier/sync_invalidation_client.h" |
#include "testing/gtest/include/gtest/gtest.h" |
namespace syncer { |
@@ -129,7 +129,7 @@ class FakeInvalidationClient : public invalidation::InvalidationClient { |
// Fake listener tkat keeps track of invalidation counts, payloads, |
// and state. |
-class FakeListener : public ChromeInvalidationClient::Listener { |
+class FakeListener : public SyncInvalidationClient::Listener { |
public: |
FakeListener() : reason_(TRANSIENT_NOTIFICATION_ERROR) {} |
virtual ~FakeListener() {} |
@@ -149,7 +149,7 @@ class FakeListener : public ChromeInvalidationClient::Listener { |
return reason_; |
} |
- // ChromeInvalidationClient::Listener implementation. |
+ // SyncInvalidationClient::Listener implementation. |
virtual void OnInvalidate(const ObjectIdStateMap& id_state_map) OVERRIDE { |
for (ObjectIdStateMap::const_iterator it = id_state_map.begin(); |
@@ -185,9 +185,9 @@ invalidation::InvalidationClient* CreateFakeInvalidationClient( |
return *fake_invalidation_client; |
} |
-class ChromeInvalidationClientTest : public testing::Test { |
+class SyncInvalidationClientTest : public testing::Test { |
protected: |
- ChromeInvalidationClientTest() |
+ SyncInvalidationClientTest() |
: kBookmarksId_(kChromeSyncSourceId, "BOOKMARK"), |
kPreferencesId_(kChromeSyncSourceId, "PREFERENCE"), |
kExtensionsId_(kChromeSyncSourceId, "EXTENSION"), |
@@ -327,12 +327,12 @@ class ChromeInvalidationClientTest : public testing::Test { |
protected: |
// Tests need to access these directly. |
FakeInvalidationClient* fake_invalidation_client_; |
- ChromeInvalidationClient client_; |
+ SyncInvalidationClient client_; |
}; |
// Write a new state to the client. It should propagate to the |
// tracker. |
-TEST_F(ChromeInvalidationClientTest, WriteState) { |
+TEST_F(SyncInvalidationClientTest, WriteState) { |
WriteState(kNewState); |
EXPECT_EQ(kNewState, GetInvalidationState()); |
@@ -342,7 +342,7 @@ TEST_F(ChromeInvalidationClientTest, WriteState) { |
// Fire an invalidation without a payload. It should be processed, |
// the payload should remain empty, and the version should be updated. |
-TEST_F(ChromeInvalidationClientTest, InvalidateNoPayload) { |
+TEST_F(SyncInvalidationClientTest, InvalidateNoPayload) { |
const ObjectId& id = kBookmarksId_; |
FireInvalidate(id, kVersion1, NULL); |
@@ -355,7 +355,7 @@ TEST_F(ChromeInvalidationClientTest, InvalidateNoPayload) { |
// Fire an invalidation with an empty payload. It should be |
// processed, the payload should remain empty, and the version should |
// be updated. |
-TEST_F(ChromeInvalidationClientTest, InvalidateEmptyPayload) { |
+TEST_F(SyncInvalidationClientTest, InvalidateEmptyPayload) { |
const ObjectId& id = kBookmarksId_; |
FireInvalidate(id, kVersion1, ""); |
@@ -367,7 +367,7 @@ TEST_F(ChromeInvalidationClientTest, InvalidateEmptyPayload) { |
// Fire an invalidation with a payload. It should be processed, and |
// both the payload and the version should be updated. |
-TEST_F(ChromeInvalidationClientTest, InvalidateWithPayload) { |
+TEST_F(SyncInvalidationClientTest, InvalidateWithPayload) { |
const ObjectId& id = kPreferencesId_; |
FireInvalidate(id, kVersion1, kPayload1); |
@@ -379,7 +379,7 @@ TEST_F(ChromeInvalidationClientTest, InvalidateWithPayload) { |
// Fire an invalidation with a payload. It should still be processed, |
// and both the payload and the version should be updated. |
-TEST_F(ChromeInvalidationClientTest, InvalidateUnregistered) { |
+TEST_F(SyncInvalidationClientTest, InvalidateUnregistered) { |
const ObjectId kUnregisteredId( |
kChromeSyncSourceId, "unregistered"); |
const ObjectId& id = kUnregisteredId; |
@@ -398,7 +398,7 @@ TEST_F(ChromeInvalidationClientTest, InvalidateUnregistered) { |
// Fire an invalidation, then fire another one with a lower version. |
// The first one should be processed and should update the payload and |
// version, but the second one shouldn't. |
-TEST_F(ChromeInvalidationClientTest, InvalidateVersion) { |
+TEST_F(SyncInvalidationClientTest, InvalidateVersion) { |
const ObjectId& id = kPreferencesId_; |
FireInvalidate(id, kVersion2, kPayload2); |
@@ -417,7 +417,7 @@ TEST_F(ChromeInvalidationClientTest, InvalidateVersion) { |
// Fire an invalidation with an unknown version twice. It shouldn't |
// update the payload or version either time, but it should still be |
// processed. |
-TEST_F(ChromeInvalidationClientTest, InvalidateUnknownVersion) { |
+TEST_F(SyncInvalidationClientTest, InvalidateUnknownVersion) { |
const ObjectId& id = kBookmarksId_; |
FireInvalidateUnknownVersion(id); |
@@ -435,7 +435,7 @@ TEST_F(ChromeInvalidationClientTest, InvalidateUnknownVersion) { |
// Fire an invalidation for all enabled IDs. It shouldn't update the |
// payload or version, but it should still invalidate the IDs. |
-TEST_F(ChromeInvalidationClientTest, InvalidateAll) { |
+TEST_F(SyncInvalidationClientTest, InvalidateAll) { |
FireInvalidateAll(); |
for (ObjectIdSet::const_iterator it = registered_ids_.begin(); |
@@ -447,7 +447,7 @@ TEST_F(ChromeInvalidationClientTest, InvalidateAll) { |
} |
// Comprehensive test of various scenarios for multiple IDs. |
-TEST_F(ChromeInvalidationClientTest, InvalidateMultipleIds) { |
+TEST_F(SyncInvalidationClientTest, InvalidateMultipleIds) { |
FireInvalidate(kBookmarksId_, 3, NULL); |
EXPECT_EQ(1, GetInvalidationCount(kBookmarksId_)); |
@@ -513,7 +513,7 @@ TEST_F(ChromeInvalidationClientTest, InvalidateMultipleIds) { |
// With IDs already registered, enable notifications then ready the |
// client. The IDs should be registered only after the client is |
// readied. |
-TEST_F(ChromeInvalidationClientTest, RegisterEnableReady) { |
+TEST_F(SyncInvalidationClientTest, RegisterEnableReady) { |
EXPECT_TRUE(GetRegisteredIds().empty()); |
EnableNotifications(); |
@@ -528,7 +528,7 @@ TEST_F(ChromeInvalidationClientTest, RegisterEnableReady) { |
// With IDs already registered, ready the client then enable |
// notifications. The IDs should be registered after the client is |
// readied. |
-TEST_F(ChromeInvalidationClientTest, RegisterReadyEnable) { |
+TEST_F(SyncInvalidationClientTest, RegisterReadyEnable) { |
EXPECT_TRUE(GetRegisteredIds().empty()); |
client_.Ready(fake_invalidation_client_); |
@@ -543,7 +543,7 @@ TEST_F(ChromeInvalidationClientTest, RegisterReadyEnable) { |
// Unregister the IDs, enable notifications, re-register the IDs, then |
// ready the client. The IDs should be registered only after the |
// client is readied. |
-TEST_F(ChromeInvalidationClientTest, EnableRegisterReady) { |
+TEST_F(SyncInvalidationClientTest, EnableRegisterReady) { |
client_.UpdateRegisteredIds(ObjectIdSet()); |
EXPECT_TRUE(GetRegisteredIds().empty()); |
@@ -564,7 +564,7 @@ TEST_F(ChromeInvalidationClientTest, EnableRegisterReady) { |
// Unregister the IDs, enable notifications, ready the client, then |
// re-register the IDs. The IDs should be registered only after the |
// client is readied. |
-TEST_F(ChromeInvalidationClientTest, EnableReadyRegister) { |
+TEST_F(SyncInvalidationClientTest, EnableReadyRegister) { |
client_.UpdateRegisteredIds(ObjectIdSet()); |
EXPECT_TRUE(GetRegisteredIds().empty()); |
@@ -585,7 +585,7 @@ TEST_F(ChromeInvalidationClientTest, EnableReadyRegister) { |
// Unregister the IDs, ready the client, enable notifications, then |
// re-register the IDs. The IDs should be registered only after the |
// client is readied. |
-TEST_F(ChromeInvalidationClientTest, ReadyEnableRegister) { |
+TEST_F(SyncInvalidationClientTest, ReadyEnableRegister) { |
client_.UpdateRegisteredIds(ObjectIdSet()); |
EXPECT_TRUE(GetRegisteredIds().empty()); |
@@ -608,7 +608,7 @@ TEST_F(ChromeInvalidationClientTest, ReadyEnableRegister) { |
// client is readied. |
// |
// This test is important: see http://crbug.com/139424. |
-TEST_F(ChromeInvalidationClientTest, ReadyRegisterEnable) { |
+TEST_F(SyncInvalidationClientTest, ReadyRegisterEnable) { |
client_.UpdateRegisteredIds(ObjectIdSet()); |
EXPECT_TRUE(GetRegisteredIds().empty()); |
@@ -628,7 +628,7 @@ TEST_F(ChromeInvalidationClientTest, ReadyRegisterEnable) { |
// With IDs already registered, ready the client, restart the client, |
// then re-ready it. The IDs should still be registered. |
-TEST_F(ChromeInvalidationClientTest, RegisterTypesPreserved) { |
+TEST_F(SyncInvalidationClientTest, RegisterTypesPreserved) { |
EXPECT_TRUE(GetRegisteredIds().empty()); |
client_.Ready(fake_invalidation_client_); |
@@ -646,7 +646,7 @@ TEST_F(ChromeInvalidationClientTest, RegisterTypesPreserved) { |
// Without readying the client, disable notifications, then enable |
// them. The listener should still think notifications are disabled. |
-TEST_F(ChromeInvalidationClientTest, EnableNotificationsNotReady) { |
+TEST_F(SyncInvalidationClientTest, EnableNotificationsNotReady) { |
EXPECT_EQ(TRANSIENT_NOTIFICATION_ERROR, |
GetNotificationsDisabledReason()); |
@@ -670,7 +670,7 @@ TEST_F(ChromeInvalidationClientTest, EnableNotificationsNotReady) { |
// Enable notifications then Ready the invalidation client. The |
// listener should then be ready. |
-TEST_F(ChromeInvalidationClientTest, EnableNotificationsThenReady) { |
+TEST_F(SyncInvalidationClientTest, EnableNotificationsThenReady) { |
EXPECT_EQ(TRANSIENT_NOTIFICATION_ERROR, GetNotificationsDisabledReason()); |
EnableNotifications(); |
@@ -684,7 +684,7 @@ TEST_F(ChromeInvalidationClientTest, EnableNotificationsThenReady) { |
// Ready the invalidation client then enable notifications. The |
// listener should then be ready. |
-TEST_F(ChromeInvalidationClientTest, ReadyThenEnableNotifications) { |
+TEST_F(SyncInvalidationClientTest, ReadyThenEnableNotifications) { |
EXPECT_EQ(TRANSIENT_NOTIFICATION_ERROR, GetNotificationsDisabledReason()); |
client_.Ready(fake_invalidation_client_); |
@@ -699,7 +699,7 @@ TEST_F(ChromeInvalidationClientTest, ReadyThenEnableNotifications) { |
// Enable notifications and ready the client. Then disable |
// notifications with an auth error and re-enable notifications. The |
// listener should go into an auth error mode and then back out. |
-TEST_F(ChromeInvalidationClientTest, PushClientAuthError) { |
+TEST_F(SyncInvalidationClientTest, PushClientAuthError) { |
EnableNotifications(); |
client_.Ready(fake_invalidation_client_); |
@@ -720,7 +720,7 @@ TEST_F(ChromeInvalidationClientTest, PushClientAuthError) { |
// error from the invalidation client. Simulate some notification |
// events, then re-ready the client. The listener should go into an |
// auth error mode and come out of it only after the client is ready. |
-TEST_F(ChromeInvalidationClientTest, InvalidationClientAuthError) { |
+TEST_F(SyncInvalidationClientTest, InvalidationClientAuthError) { |
EnableNotifications(); |
client_.Ready(fake_invalidation_client_); |