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

Unified Diff: trunk/src/components/sync_driver/ui_data_type_controller_unittest.cc

Issue 465113002: Revert 288557 "[Sync] Use OnSingleDataTypeUnrecoverableError for..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 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
« no previous file with comments | « trunk/src/components/sync_driver/ui_data_type_controller.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « trunk/src/components/sync_driver/ui_data_type_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698