chromium/components/autofill/core/browser/form_parsing/form_field_parser_unittest.cc

// Copyright 2013 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include <memory>
#include <string>
#include <tuple>
#include <vector>

#include "base/strings/utf_string_conversions.h"
#include "base/test/scoped_feature_list.h"
#include "components/autofill/core/browser/autofill_field.h"
#include "components/autofill/core/browser/form_parsing/autofill_scanner.h"
#include "components/autofill/core/browser/form_parsing/form_field_parser.h"
#include "components/autofill/core/browser/form_parsing/parsing_test_utils.h"
#include "components/autofill/core/browser/form_structure.h"
#include "components/autofill/core/common/autofill_features.h"
#include "components/autofill/core/common/autofill_payments_features.h"
#include "testing/gmock/include/gmock/gmock-matchers.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace autofill {

class FormFieldParserTest
    : public FormFieldParserTestBase,
      public ::testing::TestWithParam<PatternProviderFeatureState> {};

INSTANTIATE_TEST_SUITE_P();

struct MatchTestCase {};

class MatchTest : public testing::TestWithParam<MatchTestCase> {};

const MatchTestCase kMatchTestCases[]{};

INSTANTIATE_TEST_SUITE_P();

TEST_P(MatchTest, Match) {}

// Test that we ignore checkable elements.
TEST_P(FormFieldParserTest, ParseFormFieldsIgnoreCheckableElements) {}

// Test that the minimum number of required fields for the heuristics considers
// whether a field is actually fillable.
TEST_P(FormFieldParserTest, ParseFormFieldsEnforceMinFillableFields) {}

// Test that the parseable label is used when the feature is enabled.
TEST_P(FormFieldParserTest, TestParseableLabels) {}

// Tests that `ParseSingleFieldForms` is called as part of `ParseFormFields`.
TEST_P(FormFieldParserTest, ParseSingleFieldFormsInsideParseFormField) {}

// Test that `ParseSingleFieldForms` parses single field promo codes.
TEST_P(FormFieldParserTest, ParseFormFieldsForSingleFieldPromoCode) {}

// Test that `ParseSingleFieldForms` parses single field IBAN.
TEST_P(FormFieldParserTest, ParseSingleFieldFormsIban) {}

// Test that `ParseStandaloneCvcField` parses standalone CVC fields.
TEST_P(FormFieldParserTest, ParseStandaloneCVCFields) {}

struct ParseInAnyOrderTestcase {};

class ParseInAnyOrderTest
    : public testing::TestWithParam<ParseInAnyOrderTestcase> {};

const ParseInAnyOrderTestcase kParseInAnyOrderTestcases[]{};

INSTANTIATE_TEST_SUITE_P();

TEST_P(ParseInAnyOrderTest, ParseInAnyOrder) {}

// Today, local heuristics typically classify fields if at least 3 different
// fields get a fillable type assigned. This leads to false positives as in this
// example case. features::kAutofillMin3FieldTypesForLocalHeuristics changes the
// rule to require at least 3 different field *types*.
// Note that "fillable" refers to the field type, not whether a specific field
// is visible and editable by the user.
TEST_P(FormFieldParserTest, ParseFormRequires3DistinctFieldTypes) {}

TEST_P(FormFieldParserTest, ParseStandaloneZipDisabledForUS) {}

TEST_P(FormFieldParserTest, ParseStandaloneZipEnabledForBR) {}

TEST_P(FormFieldParserTest, ParseStandaloneEmail) {}

TEST_P(FormFieldParserTest, ParseStandaloneEmailWithNoEmailFields) {}

// Tests that an email field is recognized even though it matches the pattern
// nombre.*dirección, which is used to detect address name/type patterns.
TEST_P(FormFieldParserTest, ParseStandaloneEmailSimilarToAddressName) {}

}  // namespace autofill