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

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

Issue 9978017: [Sync] - Upload the callstacks for errors so that the line number of error is in callstack. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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/non_frontend_data_type_controller_unittest.cc
diff --git a/chrome/browser/sync/glue/non_frontend_data_type_controller_unittest.cc b/chrome/browser/sync/glue/non_frontend_data_type_controller_unittest.cc
index abdff771964653775a4a62dd95dee688ba26bfa8..5cab67f4a862c21d1c1ff3eec4b7f335ab839b55 100644
--- a/chrome/browser/sync/glue/non_frontend_data_type_controller_unittest.cc
+++ b/chrome/browser/sync/glue/non_frontend_data_type_controller_unittest.cc
@@ -144,8 +144,8 @@ class SyncNonFrontendDataTypeControllerTest : public testing::Test {
WillOnce(Return(true));
EXPECT_CALL(*model_associator_, SyncModelHasUserCreatedNodes(_)).
WillOnce(DoAll(SetArgumentPointee<0>(true), Return(true)));
- EXPECT_CALL(*model_associator_, AssociateModels(_)).
- WillOnce(Return(true));
+ EXPECT_CALL(*model_associator_, AssociateModels()).
+ WillOnce(Return(SyncError()));
EXPECT_CALL(*dtc_mock_, RecordAssociationTime(_));
}
@@ -157,13 +157,18 @@ class SyncNonFrontendDataTypeControllerTest : public testing::Test {
void SetStopExpectations() {
EXPECT_CALL(*dtc_mock_, StopModels());
EXPECT_CALL(service_, DeactivateDataType(_));
- EXPECT_CALL(*model_associator_, DisassociateModels(_));
+ EXPECT_CALL(*model_associator_, DisassociateModels()).
+ WillOnce(Return(SyncError()));
}
void SetStartFailExpectations(DataTypeController::StartResult result) {
EXPECT_CALL(*dtc_mock_, StopModels());
if (DataTypeController::IsUnrecoverableResult(result))
EXPECT_CALL(*dtc_mock_, RecordUnrecoverableError(_, _));
+ if (model_associator_) {
+ EXPECT_CALL(*model_associator_, DisassociateModels()).
+ WillOnce(Return(SyncError()));
+ }
EXPECT_CALL(*dtc_mock_, RecordStartFailure(result));
EXPECT_CALL(start_callback_, Run(result,_));
}
@@ -214,8 +219,8 @@ TEST_F(SyncNonFrontendDataTypeControllerTest, StartFirstRun) {
WillOnce(Return(true));
EXPECT_CALL(*model_associator_, SyncModelHasUserCreatedNodes(_)).
WillOnce(DoAll(SetArgumentPointee<0>(false), Return(true)));
- EXPECT_CALL(*model_associator_, AssociateModels(_)).
- WillOnce(Return(true));
+ EXPECT_CALL(*model_associator_, AssociateModels()).
+ WillOnce(Return(SyncError()));
EXPECT_CALL(*dtc_mock_, RecordAssociationTime(_));
SetActivateExpectations(DataTypeController::OK_FIRST_RUN);
EXPECT_EQ(DataTypeController::NOT_RUNNING, non_frontend_dtc_->state());
@@ -243,9 +248,8 @@ TEST_F(SyncNonFrontendDataTypeControllerTest, StartAssociationFailed) {
WillOnce(Return(true));
EXPECT_CALL(*model_associator_, SyncModelHasUserCreatedNodes(_)).
WillOnce(DoAll(SetArgumentPointee<0>(true), Return(true)));
- EXPECT_CALL(*model_associator_, AssociateModels(_)).
- WillOnce(DoAll(browser_sync::SetSyncError(syncable::AUTOFILL),
- Return(false)));
+ EXPECT_CALL(*model_associator_, AssociateModels()).
+ WillOnce(Return(SyncError(FROM_HERE, "Error", syncable::AUTOFILL)));
EXPECT_CALL(*dtc_mock_, RecordAssociationTime(_));
SetStartFailExpectations(DataTypeController::ASSOCIATION_FAILED);
// Set up association to fail with an association failed error.
@@ -302,7 +306,8 @@ TEST_F(SyncNonFrontendDataTypeControllerTest, AbortDuringAssociationInactive) {
Return(true)));
EXPECT_CALL(*model_associator_, AbortAssociation()).WillOnce(
SignalEvent(&pause_db_thread));
- EXPECT_CALL(*model_associator_, AssociateModels(_)).WillOnce(Return(true));
+ EXPECT_CALL(*model_associator_, AssociateModels()).
+ WillOnce(Return(SyncError()));
EXPECT_CALL(*dtc_mock_, RecordAssociationTime(_));
EXPECT_CALL(service_, ActivateDataType(_, _, _));
EXPECT_CALL(start_callback_, Run(DataTypeController::ABORTED,_));
@@ -331,8 +336,8 @@ TEST_F(SyncNonFrontendDataTypeControllerTest, AbortDuringAssociationActivated) {
Return(true)));
EXPECT_CALL(*model_associator_, AbortAssociation()).WillOnce(
SignalEvent(&pause_db_thread));
- EXPECT_CALL(*model_associator_, AssociateModels(_)).
- WillOnce(Return(true));
+ EXPECT_CALL(*model_associator_, AssociateModels()).
+ WillOnce(Return(SyncError()));
EXPECT_CALL(*dtc_mock_, RecordAssociationTime(_));
EXPECT_CALL(service_, ActivateDataType(_, _, _)).WillOnce(DoAll(
SignalEvent(&wait_for_db_thread_pause),
« no previous file with comments | « chrome/browser/sync/glue/non_frontend_data_type_controller.cc ('k') | chrome/browser/sync/glue/password_change_processor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698