chromium/components/autofill/core/browser/form_parsing/phone_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 "components/autofill/core/browser/form_parsing/phone_field_parser.h"

#include <stddef.h>

#include <memory>
#include <vector>

#include "base/containers/contains.h"
#include "base/memory/ptr_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/metrics/histogram_tester.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/parsing_test_utils.h"
#include "components/autofill/core/common/autofill_features.h"
#include "components/autofill/core/common/form_field_data.h"
#include "testing/gtest/include/gtest/gtest.h"

ASCIIToUTF16;

namespace autofill {

namespace {

const FormControlType kFieldTypes[] =;

}  // namespace

class PhoneFieldParserTest
    : public testing::TestWithParam<PatternProviderFeatureState> {};

void PhoneFieldParserTest::CheckField(const FieldGlobalId id,
                                      FieldType expected_type) const {}

autofill::FieldGlobalId PhoneFieldParserTest::AppendField(
    const TestFieldData& field_data) {}

void PhoneFieldParserTest::RunParsingTest(
    const std::vector<TestFieldData>& fields,
    bool expect_success) {}

FieldRendererId PhoneFieldParserTest::MakeFieldRendererId() {}

void PhoneFieldParserTest::Clear() {}

INSTANTIATE_TEST_SUITE_P();

TEST_P(PhoneFieldParserTest, Empty) {}

TEST_P(PhoneFieldParserTest, NonParse) {}

TEST_P(PhoneFieldParserTest, ParseOneLinePhoneWithDefaultToCityAndNumber) {}

TEST_P(PhoneFieldParserTest, ParseTwoLinePhone) {}

// Phone in format <field> - <field> - <field> could be either
// <area code> - <prefix> - <suffix>, or
// <country code> - <area code> - <phone>. The only distinguishing feature is
// size: <prefix> is no bigger than 3 characters, and <suffix> is no bigger
// than 4.
TEST_P(PhoneFieldParserTest, ThreePartPhoneNumber) {}

// This scenario of explicitly labeled "prefix" and "suffix" phone numbers
// encountered in http://crbug.com/40694 with page
// https://www.wrapables.com/jsp/Signup.jsp.
TEST_P(PhoneFieldParserTest, ThreePartPhoneNumberPrefixSuffix) {}

// Phone in format <country code> - <city and number>
TEST_P(PhoneFieldParserTest, CountryAndCityAndPhoneNumber) {}

// Tests that when a phone field is parsed, a metric indicating the used grammar
// is emitted.
TEST_P(PhoneFieldParserTest, GrammarMetrics) {}

// Tests if the country code, city code and phone number fields are correctly
// classified by the heuristic when the phone code is a select element.
TEST_P(PhoneFieldParserTest, CountryCodeIsSelectElement) {}

// Tests if the country code, city code and phone number fields are correctly
// classified by the heuristic when the phone code field is a select element
// consisting of valid options.
TEST_P(PhoneFieldParserTest, CountryCodeWithOptions) {}

// Tests if the country code field is correctly classified by the heuristic when
// the phone code is a select element and consists of valid options.
TEST_P(PhoneFieldParserTest, IsPhoneCountryCodeField) {}

// Tests that the month field is not classified as |PHONE_HOME_COUNTRY_CODE|.
TEST_P(PhoneFieldParserTest, IsMonthField) {}

// Tests that the day field is not classified as |PHONE_HOME_COUNTRY_CODE|.
TEST_P(PhoneFieldParserTest, IsDayField) {}

// Tests that the field is not classified as |PHONE_HOME_COUNTRY_CODE|.
TEST_P(PhoneFieldParserTest, IsYearField) {}

// Tests that the timezone field is not classified as |PHONE_HOME_COUNTRY_CODE|.
TEST_P(PhoneFieldParserTest, IsTimeZoneField) {}

}  // namespace autofill