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

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

Issue 9749012: [Sync] Have SyncableService's take ownership of their SyncChangeProcessor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Initial comments Created 8 years, 9 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/ui_data_type_controller_unittest.cc
diff --git a/chrome/browser/sync/glue/ui_data_type_controller_unittest.cc b/chrome/browser/sync/glue/ui_data_type_controller_unittest.cc
index a9ed7b0fbc289bafb4676f4dbdef1c2f804e7e56..4a99e9bee9eb3d1611b7cab99a2af5fca0694ed0 100644
--- a/chrome/browser/sync/glue/ui_data_type_controller_unittest.cc
+++ b/chrome/browser/sync/glue/ui_data_type_controller_unittest.cc
@@ -25,6 +25,10 @@ using testing::Return;
namespace browser_sync {
namespace {
+ACTION(MakeSharedChangeProcessor) {
+ return new SharedChangeProcessor();
+}
+
ACTION_P(ReturnAndRelease, change_processor) {
return change_processor->release();
}
@@ -50,12 +54,21 @@ class SyncUIDataTypeControllerTest : public testing::Test {
SetStartExpectations();
}
+ virtual void TearDown() {
+ // Must be done before we pump the loop.
+ syncable_service_.StopSyncing(type_);
+ preference_dtc_ = NULL;
+ PumpLoop();
+ }
+
protected:
void SetStartExpectations() {
// Ownership gets passed to caller of CreateGenericChangeProcessor.
change_processor_.reset(new FakeGenericChangeProcessor());
EXPECT_CALL(*profile_sync_factory_, GetSyncableServiceForType(type_)).
WillOnce(Return(syncable_service_.AsWeakPtr()));
+ EXPECT_CALL(*profile_sync_factory_, CreateSharedChangeProcessor()).
+ WillOnce(MakeSharedChangeProcessor());
EXPECT_CALL(*profile_sync_factory_, CreateGenericChangeProcessor(_, _, _)).
WillOnce(ReturnAndRelease(&change_processor_));
}

Powered by Google App Engine
This is Rietveld 408576698