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

Unified Diff: sync/notifier/p2p_invalidator_unittest.cc

Issue 12114012: Remove syncer::IncomingInvalidationSource (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove comment Created 7 years, 11 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/p2p_invalidator.cc ('k') | sync/tools/sync_listen_notifications.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/notifier/p2p_invalidator_unittest.cc
diff --git a/sync/notifier/p2p_invalidator_unittest.cc b/sync/notifier/p2p_invalidator_unittest.cc
index 577630fe8dd17ae10a4d72a9b3be259cad8fa75a..31a180e0079e8365b53d07d1d9a967f1ce116ff1 100644
--- a/sync/notifier/p2p_invalidator_unittest.cc
+++ b/sync/notifier/p2p_invalidator_unittest.cc
@@ -65,10 +65,9 @@ class P2PInvalidatorTestDelegate {
}
void TriggerOnIncomingInvalidation(
- const ObjectIdInvalidationMap& invalidation_map,
- IncomingInvalidationSource source) {
+ const ObjectIdInvalidationMap& invalidation_map) {
const P2PNotificationData notification_data(
- "", NOTIFY_ALL, invalidation_map, source);
+ "", NOTIFY_ALL, invalidation_map);
notifier::Notification notification;
notification.channel = kSyncP2PNotificationChannel;
notification.data = notification_data.ToString();
@@ -133,22 +132,21 @@ TEST_F(P2PInvalidatorTest, P2PNotificationTarget) {
TEST_F(P2PInvalidatorTest, P2PNotificationDataIsTargeted) {
{
const P2PNotificationData notification_data(
- "sender", NOTIFY_SELF, ObjectIdInvalidationMap(), REMOTE_INVALIDATION);
+ "sender", NOTIFY_SELF, ObjectIdInvalidationMap());
EXPECT_TRUE(notification_data.IsTargeted("sender"));
EXPECT_FALSE(notification_data.IsTargeted("other1"));
EXPECT_FALSE(notification_data.IsTargeted("other2"));
}
{
const P2PNotificationData notification_data(
- "sender", NOTIFY_OTHERS, ObjectIdInvalidationMap(),
- REMOTE_INVALIDATION);
+ "sender", NOTIFY_OTHERS, ObjectIdInvalidationMap());
EXPECT_FALSE(notification_data.IsTargeted("sender"));
EXPECT_TRUE(notification_data.IsTargeted("other1"));
EXPECT_TRUE(notification_data.IsTargeted("other2"));
}
{
const P2PNotificationData notification_data(
- "sender", NOTIFY_ALL, ObjectIdInvalidationMap(), REMOTE_INVALIDATION);
+ "sender", NOTIFY_ALL, ObjectIdInvalidationMap());
EXPECT_TRUE(notification_data.IsTargeted("sender"));
EXPECT_TRUE(notification_data.IsTargeted("other1"));
EXPECT_TRUE(notification_data.IsTargeted("other2"));
@@ -166,7 +164,7 @@ TEST_F(P2PInvalidatorTest, P2PNotificationDataDefault) {
const std::string& notification_data_str = notification_data.ToString();
EXPECT_EQ(
"{\"idInvalidationMap\":[],\"notificationType\":\"notifySelf\","
- "\"senderId\":\"\",\"source\":0}", notification_data_str);
+ "\"senderId\":\"\"}", notification_data_str);
P2PNotificationData notification_data_parsed;
EXPECT_TRUE(notification_data_parsed.ResetFromString(notification_data_str));
@@ -180,7 +178,7 @@ TEST_F(P2PInvalidatorTest, P2PNotificationDataNonDefault) {
ObjectIdSetToInvalidationMap(
ModelTypeSetToObjectIdSet(ModelTypeSet(BOOKMARKS, THEMES)), "");
const P2PNotificationData notification_data(
- "sender", NOTIFY_ALL, invalidation_map, LOCAL_INVALIDATION);
+ "sender", NOTIFY_ALL, invalidation_map);
EXPECT_TRUE(notification_data.IsTargeted("sender"));
EXPECT_TRUE(notification_data.IsTargeted("other1"));
EXPECT_TRUE(notification_data.IsTargeted("other2"));
@@ -196,7 +194,7 @@ TEST_F(P2PInvalidatorTest, P2PNotificationDataNonDefault) {
"\"state\":{\"ackHandle\":{\"state\":\"\",\"timestamp\":\"0\"},"
"\"payload\":\"\"}}"
"],\"notificationType\":\"notifyAll\","
- "\"senderId\":\"sender\",\"source\":1}", notification_data_str);
+ "\"senderId\":\"sender\"}", notification_data_str);
P2PNotificationData notification_data_parsed;
EXPECT_TRUE(notification_data_parsed.ResetFromString(notification_data_str));
@@ -242,7 +240,6 @@ TEST_F(P2PInvalidatorTest, NotificationsBasic) {
ModelTypeInvalidationMapToObjectIdInvalidationMap(
MakeInvalidationMap(enabled_types)),
Eq(fake_handler_.GetLastInvalidationMap()));
- EXPECT_EQ(REMOTE_INVALIDATION, fake_handler_.GetLastInvalidationSource());
// Sent with target NOTIFY_OTHERS so should not be propagated to
// |fake_handler_|.
@@ -288,7 +285,6 @@ TEST_F(P2PInvalidatorTest, SendNotificationData) {
ModelTypeInvalidationMapToObjectIdInvalidationMap(
MakeInvalidationMap(enabled_types)),
Eq(fake_handler_.GetLastInvalidationMap()));
- EXPECT_EQ(REMOTE_INVALIDATION, fake_handler_.GetLastInvalidationSource());
// Should be dropped.
invalidator->SendNotificationDataForTest(P2PNotificationData());
@@ -301,68 +297,59 @@ TEST_F(P2PInvalidatorTest, SendNotificationData) {
// Should be propagated.
invalidator->SendNotificationDataForTest(
- P2PNotificationData("sender", NOTIFY_SELF,
- invalidation_map, REMOTE_INVALIDATION));
+ P2PNotificationData("sender", NOTIFY_SELF, invalidation_map));
ReflectSentNotifications();
EXPECT_EQ(2, fake_handler_.GetInvalidationCount());
EXPECT_THAT(expected_ids, Eq(fake_handler_.GetLastInvalidationMap()));
// Should be dropped.
invalidator->SendNotificationDataForTest(
- P2PNotificationData("sender2", NOTIFY_SELF,
- invalidation_map, REMOTE_INVALIDATION));
+ P2PNotificationData("sender2", NOTIFY_SELF, invalidation_map));
ReflectSentNotifications();
EXPECT_EQ(2, fake_handler_.GetInvalidationCount());
// Should be dropped.
invalidator->SendNotificationDataForTest(
- P2PNotificationData("sender", NOTIFY_SELF,
- ObjectIdInvalidationMap(), REMOTE_INVALIDATION));
+ P2PNotificationData("sender", NOTIFY_SELF, ObjectIdInvalidationMap()));
ReflectSentNotifications();
EXPECT_EQ(2, fake_handler_.GetInvalidationCount());
// Should be dropped.
invalidator->SendNotificationDataForTest(
- P2PNotificationData("sender", NOTIFY_OTHERS,
- invalidation_map, REMOTE_INVALIDATION));
+ P2PNotificationData("sender", NOTIFY_OTHERS, invalidation_map));
ReflectSentNotifications();
EXPECT_EQ(2, fake_handler_.GetInvalidationCount());
// Should be propagated.
invalidator->SendNotificationDataForTest(
- P2PNotificationData("sender2", NOTIFY_OTHERS,
- invalidation_map, REMOTE_INVALIDATION));
+ P2PNotificationData("sender2", NOTIFY_OTHERS, invalidation_map));
ReflectSentNotifications();
EXPECT_EQ(3, fake_handler_.GetInvalidationCount());
EXPECT_THAT(expected_ids, Eq(fake_handler_.GetLastInvalidationMap()));
// Should be dropped.
invalidator->SendNotificationDataForTest(
- P2PNotificationData("sender2", NOTIFY_OTHERS,
- ObjectIdInvalidationMap(), REMOTE_INVALIDATION));
+ P2PNotificationData("sender2", NOTIFY_OTHERS, ObjectIdInvalidationMap()));
ReflectSentNotifications();
EXPECT_EQ(3, fake_handler_.GetInvalidationCount());
// Should be propagated.
invalidator->SendNotificationDataForTest(
- P2PNotificationData("sender", NOTIFY_ALL,
- invalidation_map, REMOTE_INVALIDATION));
+ P2PNotificationData("sender", NOTIFY_ALL, invalidation_map));
ReflectSentNotifications();
EXPECT_EQ(4, fake_handler_.GetInvalidationCount());
EXPECT_THAT(expected_ids, Eq(fake_handler_.GetLastInvalidationMap()));
// Should be propagated.
invalidator->SendNotificationDataForTest(
- P2PNotificationData("sender2", NOTIFY_ALL,
- invalidation_map, REMOTE_INVALIDATION));
+ P2PNotificationData("sender2", NOTIFY_ALL, invalidation_map));
ReflectSentNotifications();
EXPECT_EQ(5, fake_handler_.GetInvalidationCount());
EXPECT_THAT(expected_ids, Eq(fake_handler_.GetLastInvalidationMap()));
// Should be dropped.
invalidator->SendNotificationDataForTest(
- P2PNotificationData("sender2", NOTIFY_ALL,
- ObjectIdInvalidationMap(), REMOTE_INVALIDATION));
+ P2PNotificationData("sender2", NOTIFY_ALL, ObjectIdInvalidationMap()));
ReflectSentNotifications();
EXPECT_EQ(5, fake_handler_.GetInvalidationCount());
}
« no previous file with comments | « sync/notifier/p2p_invalidator.cc ('k') | sync/tools/sync_listen_notifications.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698