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_)); |
} |