#ifndef CHROME_BROWSER_SYNC_TEST_INTEGRATION_WALLET_HELPER_H_
#define CHROME_BROWSER_SYNC_TEST_INTEGRATION_WALLET_HELPER_H_
#include <map>
#include <string>
#include <utility>
#include <vector>
#include "base/memory/raw_ptr.h"
#include "base/scoped_observation.h"
#include "base/test/scoped_feature_list.h"
#include "base/time/time.h"
#include "chrome/browser/sync/test/integration/multi_client_status_change_checker.h"
#include "components/autofill/core/browser/payments_data_manager.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace autofill {
class AutofillWebDataService;
class CreditCard;
struct CreditCardCloudTokenData;
struct PaymentsCustomerData;
struct PaymentsMetadata;
class PersonalDataManager;
struct ServerCvc;
}
namespace sync_pb {
class DataTypeState;
class SyncEntity;
}
namespace wallet_helper {
inline constexpr char kDefaultCardID[] = …;
inline constexpr char kDefaultCustomerID[] = …;
inline constexpr char kDefaultBillingAddressID[] = …;
inline constexpr char kDefaultCreditCardCloudTokenDataID[] = …;
[[nodiscard]] autofill::PersonalDataManager* GetPersonalDataManager(int index);
[[nodiscard]] scoped_refptr<autofill::AutofillWebDataService>
GetProfileWebDataService(int index);
[[nodiscard]] scoped_refptr<autofill::AutofillWebDataService>
GetAccountWebDataService(int index);
void SetServerCreditCards(
int profile,
const std::vector<autofill::CreditCard>& credit_cards);
void SetPaymentsCustomerData(
int profile,
const autofill::PaymentsCustomerData& customer_data);
void SetCreditCardCloudTokenData(
int profile,
const std::vector<autofill::CreditCardCloudTokenData>& cloud_token_data);
void SetServerCardCredentialData(int profile,
const autofill::CreditCard& credit_card);
void RemoveServerCardCredentialData(int profile,
const autofill::CreditCard& credit_card);
void UpdateServerCardCredentialData(int profile,
const autofill::CreditCard& credit_card);
void UpdateServerCardMetadata(int profile,
const autofill::CreditCard& credit_card);
std::vector<autofill::PaymentsMetadata> GetServerCardsMetadata(int profile);
sync_pb::DataTypeState GetWalletDataTypeState(syncer::DataType type,
int profile);
sync_pb::SyncEntity CreateDefaultSyncWalletCard();
sync_pb::SyncEntity CreateSyncWalletCard(const std::string& name,
const std::string& last_four,
const std::string& billing_address_id,
const std::string& nickname = "",
int64_t instrument_id = 1);
sync_pb::SyncEntity CreateSyncPaymentsCustomerData(
const std::string& customer_id);
sync_pb::SyncEntity CreateDefaultSyncPaymentsCustomerData();
autofill::CreditCard GetDefaultCreditCard();
autofill::CreditCard GetCreditCard(const std::string& name,
const std::string& last_four);
sync_pb::SyncEntity CreateSyncCreditCardCloudTokenData(
const std::string& cloud_token_data_id);
sync_pb::SyncEntity CreateDefaultSyncCreditCardCloudTokenData();
sync_pb::SyncEntity CreateDefaultSyncWalletCredential();
sync_pb::SyncEntity CreateSyncWalletCredential(
const autofill::ServerCvc& server_cvc);
void ExpectDefaultCreditCardValues(const autofill::CreditCard& card);
void ExpectDefaultWalletCredentialValues(const autofill::CreditCard& card);
std::vector<autofill::CreditCard*> GetServerCreditCards(int profile);
}
class AutofillWalletChecker : public StatusChangeChecker,
public autofill::PaymentsDataManager::Observer { … };
class AutofillWalletMetadataSizeChecker
: public StatusChangeChecker,
public autofill::PaymentsDataManager::Observer { … };
class FullUpdateTypeProgressMarkerChecker : public StatusChangeChecker,
public syncer::SyncServiceObserver { … };
#endif