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

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

Issue 2521001: AutoFill: Make PersonalDataManager RefCountedThreadSafe. (Closed)
Patch Set: Fix lints. Created 10 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/profile.cc ('k') | chrome/browser/sync/glue/autofill_model_associator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/glue/autofill_data_type_controller_unittest.cc
diff --git a/chrome/browser/sync/glue/autofill_data_type_controller_unittest.cc b/chrome/browser/sync/glue/autofill_data_type_controller_unittest.cc
index 854ea803338e62211cbe669d9825165786a9bfe7..c2a4dbf4f679e591df486d37cce555e4f27514c7 100644
--- a/chrome/browser/sync/glue/autofill_data_type_controller_unittest.cc
+++ b/chrome/browser/sync/glue/autofill_data_type_controller_unittest.cc
@@ -90,6 +90,7 @@ class AutofillDataTypeControllerTest : public testing::Test {
virtual void SetUp() {
db_thread_.Start();
web_data_service_ = new WebDataServiceFake(true);
+ personal_data_manager_ = new PersonalDataManagerMock();
autofill_dtc_ =
new AutofillDataTypeController(&profile_sync_factory_,
&profile_,
@@ -104,8 +105,8 @@ class AutofillDataTypeControllerTest : public testing::Test {
protected:
void SetStartExpectations() {
EXPECT_CALL(profile_, GetPersonalDataManager()).
- WillRepeatedly(Return(&personal_data_manager_));
- EXPECT_CALL(personal_data_manager_, IsDataLoaded()).
+ WillRepeatedly(Return(personal_data_manager_.get()));
+ EXPECT_CALL(*(personal_data_manager_.get()), IsDataLoaded()).
WillRepeatedly(Return(true));
EXPECT_CALL(profile_, GetWebDataService(_)).
WillOnce(Return(web_data_service_.get()));
@@ -149,7 +150,7 @@ class AutofillDataTypeControllerTest : public testing::Test {
scoped_refptr<AutofillDataTypeController> autofill_dtc_;
ProfileSyncFactoryMock profile_sync_factory_;
ProfileMock profile_;
- PersonalDataManagerMock personal_data_manager_;
+ scoped_refptr<PersonalDataManagerMock> personal_data_manager_;
scoped_refptr<WebDataService> web_data_service_;
ProfileSyncServiceMock service_;
ModelAssociatorMock* model_associator_;
@@ -173,8 +174,8 @@ TEST_F(AutofillDataTypeControllerTest, StartPDMAndWDSReady) {
TEST_F(AutofillDataTypeControllerTest, AbortWhilePDMStarting) {
EXPECT_CALL(profile_, GetPersonalDataManager()).
- WillRepeatedly(Return(&personal_data_manager_));
- EXPECT_CALL(personal_data_manager_, IsDataLoaded()).
+ WillRepeatedly(Return(personal_data_manager_.get()));
+ EXPECT_CALL(*(personal_data_manager_.get()), IsDataLoaded()).
WillRepeatedly(Return(false));
autofill_dtc_->Start(NewCallback(&start_callback_, &StartCallback::Run));
EXPECT_EQ(DataTypeController::MODEL_STARTING, autofill_dtc_->state());
@@ -187,8 +188,8 @@ TEST_F(AutofillDataTypeControllerTest, AbortWhilePDMStarting) {
TEST_F(AutofillDataTypeControllerTest, AbortWhileWDSStarting) {
EXPECT_CALL(profile_, GetPersonalDataManager()).
- WillRepeatedly(Return(&personal_data_manager_));
- EXPECT_CALL(personal_data_manager_, IsDataLoaded()).
+ WillRepeatedly(Return(personal_data_manager_.get()));
+ EXPECT_CALL(*(personal_data_manager_.get()), IsDataLoaded()).
WillRepeatedly(Return(true));
scoped_refptr<WebDataServiceFake> web_data_service_not_loaded =
new WebDataServiceFake(false);
« no previous file with comments | « chrome/browser/profile.cc ('k') | chrome/browser/sync/glue/autofill_model_associator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698