chromium/components/autofill/core/browser/data_model/phone_number_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/data_model/phone_number.h"

#include <string>

#include "base/containers/contains.h"
#include "base/feature_list.h"
#include "base/ranges/algorithm.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/scoped_feature_list.h"
#include "components/autofill/core/browser/autofill_type.h"
#include "components/autofill/core/browser/data_model/autofill_profile.h"
#include "components/autofill/core/browser/field_types.h"
#include "components/autofill/core/browser/geo/phone_number_i18n.h"
#include "components/autofill/core/common/autofill_features.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

ASCIIToUTF16;

namespace autofill {

constexpr char kLocale[] =;

struct MatchingTypesTestCase {};
// Constructs a `PhoneNumber` from `number` and verifies that the matching types
// on `input` equal `expected_type` on every test case in `tests`.
// If the `number` is provided without a country code, it's region defaults to
// `country`.
// `trunk_types_enabled` determines if
// `kAutofillEnableSupportForPhoneNumberTrunkTypes` is enabled.
void MatchingTypesTest(const std::u16string& number,
                       const std::u16string& country,
                       bool trunk_types_enabled,
                       const std::vector<MatchingTypesTestCase>& tests) {}

TEST(PhoneNumberTest, Matcher) {}

TEST(PhoneNumberTest, Matcher_TrunkTypes) {}

TEST(PhoneNumberTest, Matcher_DisambiguateWholeNumber) {}

// Tests that the |PHONE_HOME_COUNTRY_CODE| should not be added to the set of
// matching types.
TEST(PhoneNumberTest, CountryCodeNotInMatchingTypes) {}

// Verify that the derived types of German numbers are correct.
TEST(PhoneNumberTest, Matcher_DE) {}

TEST(PhoneNumberTest, Matcher_TrunkTypes_DE) {}

// Verify that `PhoneNumber::SetInfo()` correctly formats the incoming number.
// `kLocale` is irrelevant, as `profile` has a country.
TEST(PhoneNumberTest, SetInfo) {}

TEST(PhoneNumberTest, InferCountryCallingCode) {}

// Test that cached phone numbers are correctly invalidated and updated.
TEST(PhoneNumberTest, UpdateCachedPhoneNumber) {}

TEST(PhoneNumberTest, PhoneCombineHelper) {}

TEST(PhoneNumberTest, HelperSetsAllPhoneFieldTypes) {}

TEST(PhoneNumberTest, InternationalPhoneHomeCityAndNumber_US) {}

// This is a regression test for crbug.com/638795.
TEST(PhoneNumberTest, InternationalPhoneHomeCityAndNumber_DE) {}

TEST(PhoneNumberTest, TrunkPrefix) {}

// Tests that PHONE_HOME_NUMBER_PREFIX and PHONE_HOME_NUMBER_PREFIX are
// extracted correctly.
TEST(PhoneNumberTest, NumberPreAndSuffixes) {}

// Tests that extensions are not stored and even stripped from the raw info.
TEST(PhoneNumberTest, Extension) {}

// The PhoneImportAndGetTest testcases simulate the steps of observing a phone
// number submission on a website (possibly spread over multiple fields) which
// is imported into an address profile, and retrieving the values that would be
// filled into a website.
// Importing a phone number actually happens in
// FormDataImporter::SetPhoneNumber, which is out of scope for this test but so
// small that we replicate it in the test.
struct PhoneImportAndGetTestCase {};

class PhoneImportAndGetTest
    : public ::testing::TestWithParam<PhoneImportAndGetTestCase> {};

TEST_P(PhoneImportAndGetTest, TestSettingAndParsing) {}

INSTANTIATE_TEST_SUITE_P();

}  // namespace autofill