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

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

Issue 10808040: [Sync] Avoid ObserverListThreadSafe in ChromeSyncNotificationBridge (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix test errors 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
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 e45ddf3dd77296481bbd9b4ea9e96de00c6187c1..e12de05edd0613f56b81f801565f1b445425f50d 100644
--- a/chrome/browser/sync/glue/bridged_sync_notifier_unittest.cc
+++ b/chrome/browser/sync/glue/bridged_sync_notifier_unittest.cc
@@ -29,14 +29,14 @@ using syncer::HasModelTypes;
class MockChromeSyncNotificationBridge : public ChromeSyncNotificationBridge {
public:
- MockChromeSyncNotificationBridge()
- : ChromeSyncNotificationBridge(&mock_profile_) {}
+ MockChromeSyncNotificationBridge(
+ const Profile* profile,
+ const scoped_refptr<base::SequencedTaskRunner>& sync_task_runner)
+ : ChromeSyncNotificationBridge(profile, sync_task_runner) {}
virtual ~MockChromeSyncNotificationBridge() {}
MOCK_METHOD1(AddObserver, void(syncer::SyncNotifierObserver*));
MOCK_METHOD1(RemoveObserver, void(syncer::SyncNotifierObserver*));
- private:
- NiceMock<ProfileMock> mock_profile_;
};
class MockSyncNotifier : public syncer::SyncNotifier {
@@ -60,6 +60,7 @@ class BridgedSyncNotifierTest : public testing::Test {
public:
BridgedSyncNotifierTest()
: ui_thread_(BrowserThread::UI, &ui_loop_),
+ mock_bridge_(&mock_profile_, ui_loop_.message_loop_proxy()),
mock_delegate_(new MockSyncNotifier), // Owned by bridged_notifier_.
bridged_notifier_(&mock_bridge_, mock_delegate_) {}
virtual ~BridgedSyncNotifierTest() {}
@@ -67,6 +68,7 @@ class BridgedSyncNotifierTest : public testing::Test {
protected:
MessageLoop ui_loop_;
content::TestBrowserThread ui_thread_;
+ NiceMock<ProfileMock> mock_profile_;
StrictMock<MockChromeSyncNotificationBridge> mock_bridge_;
MockSyncNotifier* mock_delegate_;
BridgedSyncNotifier bridged_notifier_;

Powered by Google App Engine
This is Rietveld 408576698