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

Unified Diff: sync/notifier/p2p_notifier_unittest.cc

Issue 10833004: [Sync] Make P2PNotifier emit a notification only if some enabled types changed (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed MC_DeleteBookmarks Created 8 years, 5 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_notifier.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/notifier/p2p_notifier_unittest.cc
diff --git a/sync/notifier/p2p_notifier_unittest.cc b/sync/notifier/p2p_notifier_unittest.cc
index e6e406a2d74acfd34738252785d1719c78b16578..055fd1b1ad76daf8e591d028e9a65f8de2313f26 100644
--- a/sync/notifier/p2p_notifier_unittest.cc
+++ b/sync/notifier/p2p_notifier_unittest.cc
@@ -182,12 +182,12 @@ TEST_F(P2PNotifierTest, NotificationsBasic) {
// target settings. The notifications received by the observer should
// be consistent with the target settings.
TEST_F(P2PNotifierTest, SendNotificationData) {
- ModelTypeSet enabled_types(BOOKMARKS, PREFERENCES);
-
+ ModelTypeSet enabled_types(BOOKMARKS, PREFERENCES, THEMES);
ModelTypeSet changed_types(THEMES, APPS);
+ ModelTypeSet expected_types(THEMES);
- const ModelTypePayloadMap& changed_payload_map =
- MakePayloadMap(changed_types);
+ const ModelTypePayloadMap& expected_payload_map =
+ MakePayloadMap(expected_types);
EXPECT_CALL(mock_observer_, OnNotificationsEnabled());
EXPECT_CALL(mock_observer_,
@@ -211,7 +211,7 @@ TEST_F(P2PNotifierTest, SendNotificationData) {
// Should be propagated.
Mock::VerifyAndClearExpectations(&mock_observer_);
- EXPECT_CALL(mock_observer_, OnIncomingNotification(changed_payload_map,
+ EXPECT_CALL(mock_observer_, OnIncomingNotification(expected_payload_map,
REMOTE_NOTIFICATION));
p2p_notifier_.SendNotificationDataForTest(
P2PNotificationData("sender", NOTIFY_SELF, changed_types));
@@ -240,7 +240,7 @@ TEST_F(P2PNotifierTest, SendNotificationData) {
// Should be propagated.
Mock::VerifyAndClearExpectations(&mock_observer_);
- EXPECT_CALL(mock_observer_, OnIncomingNotification(changed_payload_map,
+ EXPECT_CALL(mock_observer_, OnIncomingNotification(expected_payload_map,
REMOTE_NOTIFICATION));
p2p_notifier_.SendNotificationDataForTest(
P2PNotificationData("sender2", NOTIFY_OTHERS, changed_types));
@@ -256,7 +256,7 @@ TEST_F(P2PNotifierTest, SendNotificationData) {
// Should be propagated.
Mock::VerifyAndClearExpectations(&mock_observer_);
- EXPECT_CALL(mock_observer_, OnIncomingNotification(changed_payload_map,
+ EXPECT_CALL(mock_observer_, OnIncomingNotification(expected_payload_map,
REMOTE_NOTIFICATION));
p2p_notifier_.SendNotificationDataForTest(
P2PNotificationData("sender", NOTIFY_ALL, changed_types));
@@ -265,7 +265,7 @@ TEST_F(P2PNotifierTest, SendNotificationData) {
// Should be propagated.
Mock::VerifyAndClearExpectations(&mock_observer_);
- EXPECT_CALL(mock_observer_, OnIncomingNotification(changed_payload_map,
+ EXPECT_CALL(mock_observer_, OnIncomingNotification(expected_payload_map,
REMOTE_NOTIFICATION));
p2p_notifier_.SendNotificationDataForTest(
P2PNotificationData("sender2", NOTIFY_ALL, changed_types));
« no previous file with comments | « sync/notifier/p2p_notifier.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698