| Index: components/autofill/core/browser/personal_data_manager_unittest.cc
|
| diff --git a/components/autofill/core/browser/personal_data_manager_unittest.cc b/components/autofill/core/browser/personal_data_manager_unittest.cc
|
| index 231da52dba5b592782a76ed707e4741057349c3e..0f5052db07f133b8495c11762600a3ce7fc1a780 100644
|
| --- a/components/autofill/core/browser/personal_data_manager_unittest.cc
|
| +++ b/components/autofill/core/browser/personal_data_manager_unittest.cc
|
| @@ -176,6 +176,7 @@ class PersonalDataManagerTest : public testing::Test {
|
| signin_manager_.get(),
|
| is_incognito);
|
| personal_data_->AddObserver(&personal_data_observer_);
|
| + personal_data_->OnSyncServiceConfigured(nullptr);
|
|
|
| // Verify that the web database has been updated and the notification sent.
|
| EXPECT_CALL(personal_data_observer_, OnPersonalDataChanged())
|
| @@ -201,6 +202,7 @@ class PersonalDataManagerTest : public testing::Test {
|
| feature_list->InitializeFromCommandLine(kAutofillProfileCleanup.name,
|
| std::string());
|
| base::FeatureList::SetInstance(std::move(feature_list));
|
| + personal_data_->is_autofill_profile_dedupe_pending_ = true;
|
| }
|
|
|
| void SetupReferenceProfile() {
|
| @@ -4601,7 +4603,8 @@ TEST_F(PersonalDataManagerTest, ApplyDedupingRoutine_MergedProfileValues) {
|
|
|
| base::HistogramTester histogram_tester;
|
|
|
| - personal_data_->ApplyDedupingRoutine();
|
| + EXPECT_TRUE(personal_data_->ApplyDedupingRoutine());
|
| + personal_data_->Refresh();
|
| EXPECT_CALL(personal_data_observer_, OnPersonalDataChanged())
|
| .WillOnce(QuitMainMessageLoop());
|
| base::RunLoop().Run();
|
| @@ -4694,7 +4697,8 @@ TEST_F(PersonalDataManagerTest, ApplyDedupingRoutine_VerifiedProfileFirst) {
|
|
|
| base::HistogramTester histogram_tester;
|
|
|
| - personal_data_->ApplyDedupingRoutine();
|
| + EXPECT_TRUE(personal_data_->ApplyDedupingRoutine());
|
| + personal_data_->Refresh();
|
| EXPECT_CALL(personal_data_observer_, OnPersonalDataChanged())
|
| .WillOnce(QuitMainMessageLoop());
|
| base::RunLoop().Run();
|
| @@ -4766,7 +4770,8 @@ TEST_F(PersonalDataManagerTest, ApplyDedupingRoutine_VerifiedProfileLast) {
|
|
|
| base::HistogramTester histogram_tester;
|
|
|
| - personal_data_->ApplyDedupingRoutine();
|
| + EXPECT_TRUE(personal_data_->ApplyDedupingRoutine());
|
| + personal_data_->Refresh();
|
| EXPECT_CALL(personal_data_observer_, OnPersonalDataChanged())
|
| .WillOnce(QuitMainMessageLoop());
|
| base::RunLoop().Run();
|
| @@ -4837,7 +4842,8 @@ TEST_F(PersonalDataManagerTest, ApplyDedupingRoutine_MultipleVerifiedProfiles) {
|
|
|
| base::HistogramTester histogram_tester;
|
|
|
| - personal_data_->ApplyDedupingRoutine();
|
| + EXPECT_TRUE(personal_data_->ApplyDedupingRoutine());
|
| + personal_data_->Refresh();
|
| EXPECT_CALL(personal_data_observer_, OnPersonalDataChanged())
|
| .WillOnce(QuitMainMessageLoop());
|
| base::RunLoop().Run();
|
| @@ -5067,7 +5073,8 @@ TEST_F(PersonalDataManagerTest, ApplyDedupingRoutine_MultipleDedupes) {
|
| // |Homer1| should get merged into |Homer2| which should then be merged into
|
| // |Homer3|. |Marge2| should be discarded in favor of |Marge1| which is
|
| // verified. |Homer4| and |Barney| should not be deduped at all.
|
| - personal_data_->ApplyDedupingRoutine();
|
| + EXPECT_TRUE(personal_data_->ApplyDedupingRoutine());
|
| + personal_data_->Refresh();
|
| EXPECT_CALL(personal_data_observer_, OnPersonalDataChanged())
|
| .WillOnce(QuitMainMessageLoop());
|
| base::RunLoop().Run();
|
| @@ -5184,6 +5191,7 @@ TEST_F(PersonalDataManagerTest, ApplyDedupingRoutine_OncePerVersion) {
|
|
|
| // The deduping routine should be run a first time.
|
| EXPECT_TRUE(personal_data_->ApplyDedupingRoutine());
|
| + personal_data_->Refresh();
|
| EXPECT_CALL(personal_data_observer_, OnPersonalDataChanged())
|
| .WillOnce(QuitMainMessageLoop());
|
| base::RunLoop().Run();
|
| @@ -5217,6 +5225,7 @@ TEST_F(PersonalDataManagerTest, ApplyDedupingRoutine_OncePerVersion) {
|
|
|
| // The deduping routine should not be run.
|
| EXPECT_FALSE(personal_data_->ApplyDedupingRoutine());
|
| + personal_data_->Refresh();
|
|
|
| // The two duplicate profiles should still be present.
|
| EXPECT_EQ(2U, personal_data_->GetProfiles().size());
|
|
|