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

Unified Diff: trunk/src/chrome/browser/sync/glue/bookmark_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
Index: trunk/src/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc
===================================================================
--- trunk/src/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc (revision 289111)
+++ trunk/src/chrome/browser/sync/glue/bookmark_data_type_controller_unittest.cc (working copy)
@@ -335,3 +335,21 @@
bookmark_dtc_->Stop();
EXPECT_EQ(DataTypeController::NOT_RUNNING, bookmark_dtc_->state());
}
+
+TEST_F(SyncBookmarkDataTypeControllerTest, OnSingleDatatypeUnrecoverableError) {
+ CreateBookmarkModel(LOAD_MODEL);
+ SetStartExpectations();
+ SetAssociateExpectations();
+ EXPECT_CALL(*model_associator_, SyncModelHasUserCreatedNodes(_)).
+ WillRepeatedly(DoAll(SetArgumentPointee<0>(true), Return(true)));
+ EXPECT_CALL(service_, DisableDatatype(_)).
+ WillOnce(InvokeWithoutArgs(bookmark_dtc_.get(),
+ &BookmarkDataTypeController::Stop));
+ SetStopExpectations();
+
+ EXPECT_CALL(start_callback_, Run(DataTypeController::OK, _, _));
+ Start();
+ // This should cause bookmark_dtc_->Stop() to be called.
+ bookmark_dtc_->OnSingleDatatypeUnrecoverableError(FROM_HERE, "Test");
+ base::RunLoop().RunUntilIdle();
+}

Powered by Google App Engine
This is Rietveld 408576698