Skip to content

Commit

Permalink
Move unit tests related to PersonalDataManagerCleaner to separate uni…
Browse files Browse the repository at this point in the history
…t test file

Change-Id: I0cdab5ae07953bce116dad120b96cb1ad1a0725f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3748470
Reviewed-by: Christoph Schwering <schwering@google.com>
Commit-Queue: Vidhan Jain <vidhanj@google.com>
Cr-Commit-Position: refs/heads/main@{#1033948}
  • Loading branch information
Vidhan authored and Chromium LUCI CQ committed Aug 11, 2022
1 parent dc27724 commit 15d660d
Show file tree
Hide file tree
Showing 4 changed files with 1,296 additions and 1,228 deletions.
1 change: 1 addition & 0 deletions components/autofill/core/browser/BUILD.gn
Expand Up @@ -861,6 +861,7 @@ source_set("unit_tests") {
"payments/virtual_card_enrollment_manager_unittest.cc",
"payments/virtual_card_enrollment_strike_database_unittest.cc",
"payments/wait_for_signal_or_timeout_unittest.cc",
"personal_data_manager_cleaner_unittest.cc",
"personal_data_manager_test_base.cc",
"personal_data_manager_test_base.h",
"personal_data_manager_unittest.cc",
Expand Down
35 changes: 5 additions & 30 deletions components/autofill/core/browser/personal_data_manager.h
Expand Up @@ -370,14 +370,16 @@ class PersonalDataManager : public KeyedService,
variations_country_code_ = country_code;
}

#if BUILDFLAG(IS_IOS)
// Returns the raw pointer to PersonalDataManagerCleaner used for testing
// purposes.
PersonalDataManagerCleaner* personal_data_manager_cleaner_for_testing()
const {
DCHECK(personal_data_manager_cleaner_);
return personal_data_manager_cleaner_.get();
}
#endif
#endif // IOS
#endif // UNIT_TEST

// Returns our best guess for the country a user is likely to use when
// inputting a new address. The value is calculated once and cached, so it
Expand Down Expand Up @@ -510,32 +512,6 @@ class PersonalDataManager : public KeyedService,
FRIEND_TEST_ALL_PREFIXES(PersonalDataManagerTest, GetCreditCardByServerId);
FRIEND_TEST_ALL_PREFIXES(PersonalDataManagerTest,
AddAndGetCreditCardArtImage);
FRIEND_TEST_ALL_PREFIXES(PersonalDataManagerTest,
DedupeProfiles_ProfilesToDelete);
FRIEND_TEST_ALL_PREFIXES(PersonalDataManagerTest,
DedupeProfiles_GuidsMergeMap);
FRIEND_TEST_ALL_PREFIXES(PersonalDataManagerTest,
UpdateCardsBillingAddressReference);
FRIEND_TEST_ALL_PREFIXES(PersonalDataManagerTest,
ApplyDedupingRoutine_CardsBillingAddressIdUpdated);
FRIEND_TEST_ALL_PREFIXES(PersonalDataManagerTest,
ApplyDedupingRoutine_MergedProfileValues);
FRIEND_TEST_ALL_PREFIXES(PersonalDataManagerTest,
ApplyDedupingRoutine_VerifiedProfileFirst);
FRIEND_TEST_ALL_PREFIXES(PersonalDataManagerTest,
ApplyDedupingRoutine_VerifiedProfileLast);
FRIEND_TEST_ALL_PREFIXES(PersonalDataManagerTest,
ApplyDedupingRoutine_MultipleVerifiedProfiles);
FRIEND_TEST_ALL_PREFIXES(PersonalDataManagerTest,
ApplyDedupingRoutine_FeatureDisabled);
FRIEND_TEST_ALL_PREFIXES(PersonalDataManagerTest,
ApplyDedupingRoutine_NopIfZeroProfiles);
FRIEND_TEST_ALL_PREFIXES(PersonalDataManagerTest,
ApplyDedupingRoutine_NopIfOneProfile);
FRIEND_TEST_ALL_PREFIXES(PersonalDataManagerTest,
ApplyDedupingRoutine_OncePerVersion);
FRIEND_TEST_ALL_PREFIXES(PersonalDataManagerTest,
ApplyDedupingRoutine_MultipleDedupes);
FRIEND_TEST_ALL_PREFIXES(
PersonalDataManagerTest,
ConvertWalletAddressesAndUpdateWalletCards_NewProfile);
Expand All @@ -555,9 +531,6 @@ class PersonalDataManager : public KeyedService,
DoNotConvertWalletAddressesInEphemeralStorage);
FRIEND_TEST_ALL_PREFIXES(PersonalDataManagerTest,
DeleteDisusedCreditCards_DoNothingWhenDisabled);
FRIEND_TEST_ALL_PREFIXES(
PersonalDataManagerTest,
DeleteDisusedCreditCards_OnlyDeleteExpiredDisusedLocalCards);
FRIEND_TEST_ALL_PREFIXES(PersonalDataManagerTest,
GetProfileSuggestions_ProfileAutofillDisabled);
FRIEND_TEST_ALL_PREFIXES(PersonalDataManagerTest,
Expand All @@ -572,6 +545,8 @@ class PersonalDataManager : public KeyedService,
PersonalDataManagerTest,
GetCreditCardsToSuggest_NoCreditCardsAddedIfDisabled);
FRIEND_TEST_ALL_PREFIXES(PersonalDataManagerTest, LogStoredCreditCardMetrics);
FRIEND_TEST_ALL_PREFIXES(PersonalDataManagerCleanerTest,
UpdateCardsBillingAddressReference);

friend class autofill::AutofillInteractiveTest;
friend class autofill::PersonalDataManagerCleaner;
Expand Down

0 comments on commit 15d660d

Please sign in to comment.