Index: trunk/src/components/sync_driver/ui_data_type_controller_unittest.cc |
=================================================================== |
--- trunk/src/components/sync_driver/ui_data_type_controller_unittest.cc (revision 289111) |
+++ trunk/src/components/sync_driver/ui_data_type_controller_unittest.cc (working copy) |
@@ -31,13 +31,17 @@ |
public: |
SyncUIDataTypeControllerTest() |
: type_(syncer::PREFERENCES), |
- change_processor_(NULL) {} |
+ change_processor_(NULL), |
+ disable_callback_invoked_(false) {} |
virtual void SetUp() { |
preference_dtc_ = |
new UIDataTypeController( |
base::MessageLoopProxy::current(), |
base::Closure(), |
+ base::Bind(&SyncUIDataTypeControllerTest::DisableTypeCallback, |
+ base::Unretained(this), |
+ type_), |
type_, |
this); |
SetStartExpectations(); |
@@ -85,6 +89,13 @@ |
message_loop_.RunUntilIdle(); |
} |
+ void DisableTypeCallback(syncer::ModelType type, |
+ const tracked_objects::Location& location, |
+ const std::string& message) { |
+ disable_callback_invoked_ = true; |
+ preference_dtc_->Stop(); |
+ } |
+ |
base::MessageLoopForUI message_loop_; |
const syncer::ModelType type_; |
StartCallbackMock start_callback_; |
@@ -92,6 +103,7 @@ |
scoped_refptr<UIDataTypeController> preference_dtc_; |
FakeGenericChangeProcessor* change_processor_; |
syncer::FakeSyncableService syncable_service_; |
+ bool disable_callback_invoked_; |
}; |
// Start the DTC. Verify that the callback is called with OK, the |
@@ -188,11 +200,7 @@ |
testing::Mock::VerifyAndClearExpectations(&start_callback_); |
EXPECT_CALL(start_callback_, Run(DataTypeController::RUNTIME_ERROR, _, _)); |
- syncer::SyncError error(FROM_HERE, |
- syncer::SyncError::DATATYPE_ERROR, |
- "error", |
- syncer::PREFERENCES); |
- preference_dtc_->OnSingleDataTypeUnrecoverableError(error); |
+ preference_dtc_->OnSingleDatatypeUnrecoverableError(FROM_HERE, "Test"); |
} |
} // namespace |