#include "components/autofill/core/browser/validation.h"
#include <stddef.h>
#include <string>
#include "base/strings/utf_string_conversions.h"
#include "base/test/scoped_feature_list.h"
#include "base/time/time.h"
#include "components/autofill/core/common/autofill_payments_features.h"
#include "components/autofill/core/common/credit_card_network_identifiers.h"
#include "components/strings/grit/components_strings.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace autofill {
namespace {
struct ExpirationDate { … };
struct IntExpirationDate { … };
struct SecurityCodeCardTypePair { … };
const char kCurrentDate[] = …;
const IntExpirationDate kValidCreditCardIntExpirationDate[] = …;
const IntExpirationDate kInvalidCreditCardIntExpirationDate[] = …;
const SecurityCodeCardTypePair kValidSecurityCodeCardTypePairs[] = …;
const SecurityCodeCardTypePair kInvalidSecurityCodeCardTypePairs[] = …;
const char16_t* const kValidEmailAddress[] = …;
const char16_t* const kInvalidEmailAddress[] = …;
const char16_t* const kUnplausibleCreditCardExpirationYears[] = …;
const char16_t* const kPlausibleCreditCardExpirationYears[] = …;
const char16_t* const kUnplausibleCreditCardCVCNumbers[] = …;
const char16_t* const kPlausibleCreditCardCVCNumbers[] = …;
}
TEST(AutofillValidation, IsPlausibleCreditCardExparationYear) { … }
TEST(AutofillValidation, IsPlausibleCreditCardCVCNumber) { … }
TEST(AutofillValidation, IsValidCreditCardIntExpirationDate) { … }
TEST(AutofillValidation, IsValidCreditCardSecurityCode) { … }
TEST(AutofillValidation, IsValidCreditCardSecurityCode_BackOfAmexCvc) { … }
TEST(AutofillValidation, IsInvalidCreditCardSecurityCode_BackOfAmexCvc) { … }
TEST(AutofillValidation, IsValidEmailAddress) { … }
struct GetCvcLengthForCardTypeCase { … };
class AutofillGetCvcLengthForCardType
: public testing::TestWithParam<GetCvcLengthForCardTypeCase> { … };
TEST_P(AutofillGetCvcLengthForCardType, GetCvcLengthForCardNetwork) { … }
INSTANTIATE_TEST_SUITE_P(…);
class AutofillIsUPIVirtualPaymentAddress
: public testing::TestWithParam<std::u16string> { … };
TEST_P(AutofillIsUPIVirtualPaymentAddress, IsUPIVirtualPaymentAddress_Banks) { … }
INSTANTIATE_TEST_SUITE_P(…);
TEST(AutofillValidation, IsUPIVirtualPaymentAddress_Others) { … }
class AutofillIsInternationalBankAccountNumber
: public testing::TestWithParam<std::u16string> { … };
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(AutofillIsInternationalBankAccountNumber,
IsInternationalBankAccountNumber) { … }
}