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

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: For review. Created 8 years, 9 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..1e6de4a1c3990c52b9a05a1ab3891d5ea5a30a2b 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,17 @@ 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()).
Nicolas Zea 2012/04/05 22:08:58 curly braces for multiline if
lipalani1 2012/04/05 22:51:03 Done.
+ WillOnce(Return(SyncError()));
EXPECT_CALL(*dtc_mock_, RecordStartFailure(result));
EXPECT_CALL(start_callback_, Run(result,_));
}
@@ -214,8 +218,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 +247,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 +305,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 +335,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),

Powered by Google App Engine
This is Rietveld 408576698