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

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

Issue 16290004: Update chrome/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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 | « chrome/browser/sync/glue/favicon_cache.cc ('k') | chrome/browser/sync/glue/model_association_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/glue/frontend_data_type_controller_unittest.cc
diff --git a/chrome/browser/sync/glue/frontend_data_type_controller_unittest.cc b/chrome/browser/sync/glue/frontend_data_type_controller_unittest.cc
index 981e8486d5251666dfe000bb579f5c8b3f46ce11..c9422a3d855fce7513ba87853abfadbab1b4d940 100644
--- a/chrome/browser/sync/glue/frontend_data_type_controller_unittest.cc
+++ b/chrome/browser/sync/glue/frontend_data_type_controller_unittest.cc
@@ -99,7 +99,7 @@ class SyncFrontendDataTypeControllerTest : public testing::Test {
protected:
void SetStartExpectations() {
- EXPECT_CALL(*dtc_mock_, StartModels()).WillOnce(Return(true));
+ EXPECT_CALL(*dtc_mock_.get(), StartModels()).WillOnce(Return(true));
EXPECT_CALL(model_load_callback_, Run(_, _));
model_associator_ = new ModelAssociatorMock();
change_processor_ = new ChangeProcessorMock();
@@ -115,7 +115,7 @@ class SyncFrontendDataTypeControllerTest : public testing::Test {
WillOnce(DoAll(SetArgumentPointee<0>(true), Return(true)));
EXPECT_CALL(*model_associator_, AssociateModels(_, _)).
WillOnce(Return(syncer::SyncError()));
- EXPECT_CALL(*dtc_mock_, RecordAssociationTime(_));
+ EXPECT_CALL(*dtc_mock_.get(), RecordAssociationTime(_));
}
void SetActivateExpectations(DataTypeController::StartResult result) {
@@ -124,7 +124,7 @@ class SyncFrontendDataTypeControllerTest : public testing::Test {
}
void SetStopExpectations() {
- EXPECT_CALL(*dtc_mock_, CleanUpState());
+ EXPECT_CALL(*dtc_mock_.get(), CleanUpState());
EXPECT_CALL(service_, DeactivateDataType(_));
EXPECT_CALL(*model_associator_, DisassociateModels()).
WillOnce(Return(syncer::SyncError()));
@@ -132,9 +132,9 @@ class SyncFrontendDataTypeControllerTest : public testing::Test {
void SetStartFailExpectations(DataTypeController::StartResult result) {
if (DataTypeController::IsUnrecoverableResult(result))
- EXPECT_CALL(*dtc_mock_, RecordUnrecoverableError(_, _));
- EXPECT_CALL(*dtc_mock_, CleanUpState());
- EXPECT_CALL(*dtc_mock_, RecordStartFailure(result));
+ EXPECT_CALL(*dtc_mock_.get(), RecordUnrecoverableError(_, _));
+ EXPECT_CALL(*dtc_mock_.get(), CleanUpState());
+ EXPECT_CALL(*dtc_mock_.get(), RecordStartFailure(result));
EXPECT_CALL(start_callback_, Run(result, _, _));
}
@@ -181,7 +181,7 @@ TEST_F(SyncFrontendDataTypeControllerTest, StartFirstRun) {
WillOnce(DoAll(SetArgumentPointee<0>(false), Return(true)));
EXPECT_CALL(*model_associator_, AssociateModels(_, _)).
WillOnce(Return(syncer::SyncError()));
- EXPECT_CALL(*dtc_mock_, RecordAssociationTime(_));
+ EXPECT_CALL(*dtc_mock_.get(), RecordAssociationTime(_));
SetActivateExpectations(DataTypeController::OK_FIRST_RUN);
EXPECT_EQ(DataTypeController::NOT_RUNNING, frontend_dtc_->state());
Start();
@@ -189,8 +189,8 @@ TEST_F(SyncFrontendDataTypeControllerTest, StartFirstRun) {
}
TEST_F(SyncFrontendDataTypeControllerTest, AbortDuringStartModels) {
- EXPECT_CALL(*dtc_mock_, StartModels()).WillOnce(Return(false));
- EXPECT_CALL(*dtc_mock_, CleanUpState());
+ EXPECT_CALL(*dtc_mock_.get(), StartModels()).WillOnce(Return(false));
+ EXPECT_CALL(*dtc_mock_.get(), CleanUpState());
EXPECT_CALL(model_load_callback_, Run(_, _));
EXPECT_EQ(DataTypeController::NOT_RUNNING, frontend_dtc_->state());
frontend_dtc_->LoadModels(
@@ -212,7 +212,7 @@ TEST_F(SyncFrontendDataTypeControllerTest, StartAssociationFailed) {
"error",
syncer::BOOKMARKS)));
- EXPECT_CALL(*dtc_mock_, RecordAssociationTime(_));
+ EXPECT_CALL(*dtc_mock_.get(), RecordAssociationTime(_));
SetStartFailExpectations(DataTypeController::ASSOCIATION_FAILED);
// Set up association to fail with an association failed error.
EXPECT_EQ(DataTypeController::NOT_RUNNING, frontend_dtc_->state());
@@ -261,10 +261,10 @@ TEST_F(SyncFrontendDataTypeControllerTest, OnSingleDatatypeUnrecoverableError) {
SetStartExpectations();
SetAssociateExpectations();
SetActivateExpectations(DataTypeController::OK);
- EXPECT_CALL(*dtc_mock_, RecordUnrecoverableError(_, "Test"));
- EXPECT_CALL(service_, DisableBrokenDatatype(_,_,_)).
- WillOnce(InvokeWithoutArgs(frontend_dtc_.get(),
- &FrontendDataTypeController::Stop));
+ EXPECT_CALL(*dtc_mock_.get(), RecordUnrecoverableError(_, "Test"));
+ EXPECT_CALL(service_, DisableBrokenDatatype(_, _, _))
+ .WillOnce(InvokeWithoutArgs(frontend_dtc_.get(),
+ &FrontendDataTypeController::Stop));
SetStopExpectations();
EXPECT_EQ(DataTypeController::NOT_RUNNING, frontend_dtc_->state());
Start();
« no previous file with comments | « chrome/browser/sync/glue/favicon_cache.cc ('k') | chrome/browser/sync/glue/model_association_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698