Index: chrome/browser/sync/glue/bridged_sync_notifier_unittest.cc |
diff --git a/chrome/browser/sync/glue/bridged_sync_notifier_unittest.cc b/chrome/browser/sync/glue/bridged_sync_notifier_unittest.cc |
index e12de05edd0613f56b81f801565f1b445425f50d..7347eacd9617d6184e2dec33c36e803e1d8c4336 100644 |
--- a/chrome/browser/sync/glue/bridged_sync_notifier_unittest.cc |
+++ b/chrome/browser/sync/glue/bridged_sync_notifier_unittest.cc |
@@ -35,8 +35,8 @@ class MockChromeSyncNotificationBridge : public ChromeSyncNotificationBridge { |
: ChromeSyncNotificationBridge(profile, sync_task_runner) {} |
virtual ~MockChromeSyncNotificationBridge() {} |
- MOCK_METHOD1(AddObserver, void(syncer::SyncNotifierObserver*)); |
- MOCK_METHOD1(RemoveObserver, void(syncer::SyncNotifierObserver*)); |
+ MOCK_METHOD2(UpdateRegisteredIds, void(syncer::SyncNotifierObserver*, |
+ const syncer::ObjectIdSet&)); |
}; |
class MockSyncNotifier : public syncer::SyncNotifier { |
@@ -44,18 +44,17 @@ class MockSyncNotifier : public syncer::SyncNotifier { |
MockSyncNotifier() {} |
virtual ~MockSyncNotifier() {} |
- MOCK_METHOD1(AddObserver, void(syncer::SyncNotifierObserver*)); |
- MOCK_METHOD1(RemoveObserver, void(syncer::SyncNotifierObserver*)); |
+ MOCK_METHOD2(UpdateRegisteredIds, |
+ void(syncer::SyncNotifierObserver*, const syncer::ObjectIdSet&)); |
MOCK_METHOD1(SetUniqueId, void(const std::string&)); |
MOCK_METHOD1(SetStateDeprecated, void(const std::string&)); |
MOCK_METHOD2(UpdateCredentials, void(const std::string&, const std::string&)); |
- MOCK_METHOD1(UpdateEnabledTypes, void(syncer::ModelTypeSet)); |
MOCK_METHOD1(SendNotification, void(syncer::ModelTypeSet)); |
}; |
// All tests just verify that each call is passed through to the delegate, with |
-// the exception of AddObserver/RemoveObserver, which also verify the observer |
-// is registered with the bridge. |
+// the exception of UpdateRegisteredIds, which also verifies the call is |
+// forwarded to the bridge. |
class BridgedSyncNotifierTest : public testing::Test { |
public: |
BridgedSyncNotifierTest() |
@@ -74,18 +73,13 @@ class BridgedSyncNotifierTest : public testing::Test { |
BridgedSyncNotifier bridged_notifier_; |
}; |
-TEST_F(BridgedSyncNotifierTest, AddObserver) { |
+TEST_F(BridgedSyncNotifierTest, UpdateRegisteredIds) { |
syncer::MockSyncNotifierObserver observer; |
- EXPECT_CALL(mock_bridge_, AddObserver(&observer)); |
- EXPECT_CALL(*mock_delegate_, AddObserver(&observer)); |
- bridged_notifier_.AddObserver(&observer); |
-} |
- |
-TEST_F(BridgedSyncNotifierTest, RemoveObserver) { |
- syncer::MockSyncNotifierObserver observer; |
- EXPECT_CALL(mock_bridge_, RemoveObserver(&observer)); |
- EXPECT_CALL(*mock_delegate_, RemoveObserver(&observer)); |
- bridged_notifier_.RemoveObserver(&observer); |
+ EXPECT_CALL(mock_bridge_, UpdateRegisteredIds( |
+ &observer, syncer::ObjectIdSet())); |
+ EXPECT_CALL(*mock_delegate_, UpdateRegisteredIds( |
+ &observer, syncer::ObjectIdSet())); |
+ bridged_notifier_.UpdateRegisteredIds(&observer, syncer::ObjectIdSet()); |
} |
TEST_F(BridgedSyncNotifierTest, SetUniqueId) { |
@@ -107,13 +101,6 @@ TEST_F(BridgedSyncNotifierTest, UpdateCredentials) { |
bridged_notifier_.UpdateCredentials(email, token); |
} |
-TEST_F(BridgedSyncNotifierTest, UpdateEnabledTypes) { |
- syncer::ModelTypeSet enabled_types(syncer::BOOKMARKS, syncer::PREFERENCES); |
- EXPECT_CALL(*mock_delegate_, |
- UpdateEnabledTypes(HasModelTypes(enabled_types))); |
- bridged_notifier_.UpdateEnabledTypes(enabled_types); |
-} |
- |
TEST_F(BridgedSyncNotifierTest, SendNotification) { |
syncer::ModelTypeSet changed_types(syncer::SESSIONS, syncer::EXTENSIONS); |
EXPECT_CALL(*mock_delegate_, SendNotification(HasModelTypes(changed_types))); |