#include "base/notreached.h"
#include "chrome/browser/sync/test/integration/fake_server_match_status_checker.h"
#include "chrome/browser/sync/test/integration/sync_service_impl_harness.h"
#include "chrome/browser/sync/test/integration/sync_test.h"
#include "chrome/browser/sync/test/integration/wallet_helper.h"
#include "components/autofill/core/browser/data_model/credit_card.h"
#include "components/autofill/core/browser/payments_data_manager.h"
#include "components/autofill/core/browser/personal_data_manager.h"
#include "components/autofill/core/browser/personal_data_manager_observer.h"
#include "components/autofill/core/browser/personal_data_manager_test_utils.h"
#include "components/autofill/core/common/autofill_payments_features.h"
#include "components/sync/base/data_type.h"
#include "components/sync/base/features.h"
#include "components/sync/engine/loopback_server/persistent_tombstone_entity.h"
#include "content/public/test/browser_test.h"
ServerCvc;
kSyncAutofillWalletCredentialData;
CreateDefaultSyncWalletCard;
CreateDefaultSyncWalletCredential;
CreateSyncPaymentsCustomerData;
CreateSyncWalletCard;
CreateSyncWalletCredential;
ExpectDefaultWalletCredentialValues;
GetAccountWebDataService;
GetPersonalDataManager;
GetProfileWebDataService;
kDefaultBillingAddressID;
namespace {
class ServerCvcChecker : public fake_server::FakeServerMatchStatusChecker { … };
ServerCvcChecker::ServerCvcChecker(const size_t expected_count)
: … { … }
ServerCvcChecker::~ServerCvcChecker() = default;
bool ServerCvcChecker::IsExitConditionSatisfied(std::ostream* os) { … }
class AutofillWebDataServiceConsumer : public WebDataServiceConsumer { … };
#if !BUILDFLAG(IS_CHROMEOS_ASH)
std::vector<std::unique_ptr<autofill::CreditCard>> GetServerCards(
scoped_refptr<autofill::AutofillWebDataService> service) { … }
#endif
}
class SingleClientWalletCredentialSyncTest : public SyncTest { … };
IN_PROC_BROWSER_TEST_F(SingleClientWalletCredentialSyncTest, EnabledByDefault) { … }
#if !BUILDFLAG(IS_CHROMEOS_ASH)
IN_PROC_BROWSER_TEST_F(SingleClientWalletCredentialSyncTest,
DownloadCardCredential) { … }
IN_PROC_BROWSER_TEST_F(SingleClientWalletCredentialSyncTest,
ClearOnSignOutAndDownstreamOnSignIn) { … }
IN_PROC_BROWSER_TEST_F(SingleClientWalletCredentialSyncTest,
CorrectCvcSyncAttachedToCardEntity) { … }
IN_PROC_BROWSER_TEST_F(SingleClientWalletCredentialSyncTest, ClearOnSignOut) { … }
IN_PROC_BROWSER_TEST_F(SingleClientWalletCredentialSyncTest,
ClearOnSignOutFromTransportMode) { … }
#endif
IN_PROC_BROWSER_TEST_F(SingleClientWalletCredentialSyncTest,
ClearOnDisablePaymentsSync) { … }
IN_PROC_BROWSER_TEST_F(SingleClientWalletCredentialSyncTest,
ClearOnSyncPaused) { … }
IN_PROC_BROWSER_TEST_F(SingleClientWalletCredentialSyncTest,
NewSyncDataShouldBeIncremental) { … }
IN_PROC_BROWSER_TEST_F(SingleClientWalletCredentialSyncTest,
ClearOnDisableWalletSync) { … }
IN_PROC_BROWSER_TEST_F(SingleClientWalletCredentialSyncTest,
ReconcileServerCvcForWalletCards) { … }