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

Unified Diff: chrome/browser/sync/glue/bridged_sync_notifier_unittest.cc

Issue 10824252: Revert 150990 - [Sync] Avoid unregistering object IDs on shutdown (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 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
Index: chrome/browser/sync/glue/bridged_sync_notifier_unittest.cc
===================================================================
--- chrome/browser/sync/glue/bridged_sync_notifier_unittest.cc (revision 150991)
+++ chrome/browser/sync/glue/bridged_sync_notifier_unittest.cc (working copy)
@@ -35,11 +35,8 @@
: ChromeSyncNotificationBridge(profile, sync_task_runner) {}
virtual ~MockChromeSyncNotificationBridge() {}
- MOCK_METHOD1(RegisterHandler, void(syncer::SyncNotifierObserver*));
- MOCK_METHOD2(UpdateRegisteredIds,
- void(syncer::SyncNotifierObserver*,
- const syncer::ObjectIdSet&));
- MOCK_METHOD1(UnregisterHandler, void(syncer::SyncNotifierObserver*));
+ MOCK_METHOD2(UpdateRegisteredIds, void(syncer::SyncNotifierObserver*,
+ const syncer::ObjectIdSet&));
};
class MockSyncNotifier : public syncer::SyncNotifier {
@@ -47,11 +44,8 @@
MockSyncNotifier() {}
virtual ~MockSyncNotifier() {}
- MOCK_METHOD1(RegisterHandler, void(syncer::SyncNotifierObserver*));
MOCK_METHOD2(UpdateRegisteredIds,
- void(syncer::SyncNotifierObserver*,
- const syncer::ObjectIdSet&));
- MOCK_METHOD1(UnregisterHandler, void(syncer::SyncNotifierObserver*));
+ 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&));
@@ -59,9 +53,8 @@
};
// All tests just verify that each call is passed through to the delegate, with
-// the exception of RegisterHandler, UnregisterHandler, and
-// UpdateRegisteredIds, which also verifies the call is forwarded to the
-// bridge.
+// the exception of UpdateRegisteredIds, which also verifies the call is
+// forwarded to the bridge.
class BridgedSyncNotifierTest : public testing::Test {
public:
BridgedSyncNotifierTest()
@@ -80,28 +73,15 @@
BridgedSyncNotifier bridged_notifier_;
};
-TEST_F(BridgedSyncNotifierTest, RegisterHandler) {
- syncer::MockSyncNotifierObserver observer;
- EXPECT_CALL(mock_bridge_, RegisterHandler(&observer));
- EXPECT_CALL(*mock_delegate_, RegisterHandler(&observer));
- bridged_notifier_.RegisterHandler(&observer);
-}
-
TEST_F(BridgedSyncNotifierTest, UpdateRegisteredIds) {
+ syncer::MockSyncNotifierObserver observer;
EXPECT_CALL(mock_bridge_, UpdateRegisteredIds(
- NULL, syncer::ObjectIdSet()));
+ &observer, syncer::ObjectIdSet()));
EXPECT_CALL(*mock_delegate_, UpdateRegisteredIds(
- NULL, syncer::ObjectIdSet()));
- bridged_notifier_.UpdateRegisteredIds(NULL, syncer::ObjectIdSet());
+ &observer, syncer::ObjectIdSet()));
+ bridged_notifier_.UpdateRegisteredIds(&observer, syncer::ObjectIdSet());
}
-TEST_F(BridgedSyncNotifierTest, UnregisterHandler) {
- syncer::MockSyncNotifierObserver observer;
- EXPECT_CALL(mock_bridge_, UnregisterHandler(&observer));
- EXPECT_CALL(*mock_delegate_, UnregisterHandler(&observer));
- bridged_notifier_.UnregisterHandler(&observer);
-}
-
TEST_F(BridgedSyncNotifierTest, SetUniqueId) {
std::string unique_id = "unique id";
EXPECT_CALL(*mock_delegate_, SetUniqueId(unique_id));
« no previous file with comments | « chrome/browser/sync/glue/bridged_sync_notifier.cc ('k') | chrome/browser/sync/glue/chrome_sync_notification_bridge.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698