#include "components/autofill/core/browser/crowdsourcing/determine_possible_field_types.h"
#include "base/feature_list.h"
#include "base/strings/stringprintf.h"
#include "components/autofill/core/browser/autofill_test_utils.h"
#include "components/autofill/core/browser/data_model/autofill_i18n_api.h"
#include "components/autofill/core/browser/data_model/autofill_profile.h"
#include "components/autofill/core/browser/data_model/credit_card.h"
#include "components/autofill/core/browser/field_types.h"
#include "components/autofill/core/common/autofill_features.h"
#include "components/autofill/core/common/autofill_test_utils.h"
#include "components/autofill/core/common/form_data_test_api.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace autofill {
namespace {
CreateTestFormField;
CreateTestSelectOrSelectListField;
Contains;
ElementsAre;
Not;
void CheckThatOnlyFieldByIndexHasThisPossibleType(
const FormStructure& form_structure,
size_t field_index,
FieldType type,
FieldPropertiesMask mask) { … }
void CheckThatNoFieldHasThisPossibleType(const FormStructure& form_structure,
FieldType type) { … }
struct TestAddressFillData { … };
TestAddressFillData GetElvisAddressFillData() { … }
AutofillProfile FillDataToAutofillProfile(const TestAddressFillData& data) { … }
std::string MakeGuid(size_t last_digit) { … }
struct ProfileMatchingTypesTestCase { … };
class ProfileMatchingTypesTest
: public ::testing::Test,
public ::testing::WithParamInterface<ProfileMatchingTypesTestCase> { … };
const ProfileMatchingTypesTestCase kProfileMatchingTypesTestCases[] = …;
TEST_P(ProfileMatchingTypesTest, DeterminePossibleFieldTypesForUpload) { … }
INSTANTIATE_TEST_SUITE_P(…);
class DeterminePossibleFieldTypesForUploadTest : public ::testing::Test { … };
TEST_F(DeterminePossibleFieldTypesForUploadTest, CrowdsourceCVCFieldByValue) { … }
TEST_F(DeterminePossibleFieldTypesForUploadTest,
CrowdsourceCVCFieldAfterInvalidExpDateByHeuristics) { … }
TEST_F(DeterminePossibleFieldTypesForUploadTest,
CrowdsourceCVCFieldAfterExpDateByHeuristics) { … }
TEST_F(DeterminePossibleFieldTypesForUploadTest,
CrowdsourceCVCFieldBeforeExpDateByHeuristics) { … }
TEST_F(DeterminePossibleFieldTypesForUploadTest,
CrowdsourceNoCVCFieldDueToMissingCreditCardNumber) { … }
TEST_F(DeterminePossibleFieldTypesForUploadTest,
CrowdsourceNoCVCDueToInvalidCandidateValue) { … }
TEST_F(DeterminePossibleFieldTypesForUploadTest,
CrowdsourceEmailFieldsByValue) { … }
}
}