chromium/components/autofill/core/browser/data_model/autofill_profile_comparator_unittest.cc

// Copyright 2016 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/autofill_profile_comparator.h"

#include <string_view>

#include "base/containers/contains.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/task_environment.h"
#include "base/uuid.h"
#include "components/autofill/core/browser/autofill_test_utils.h"
#include "components/autofill/core/browser/data_model/autofill_profile.h"
#include "components/autofill/core/browser/data_model/autofill_structured_address_component.h"
#include "components/autofill/core/browser/data_model/autofill_structured_address_utils.h"
#include "components/autofill/core/browser/data_model/contact_info.h"
#include "components/autofill/core/browser/field_types.h"
#include "components/autofill/core/browser/geo/alternative_state_name_map_test_utils.h"
#include "components/autofill/core/common/autofill_clock.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace autofill {

namespace {

kLegacyHierarchyCountryCode;

const char kLocale[] =;

class AutofillProfileComparatorTest : public testing::Test {};

TEST_F(AutofillProfileComparatorTest, UniqueTokens) {}

TEST_F(AutofillProfileComparatorTest, CompareTokens) {}

TEST_F(AutofillProfileComparatorTest, Compare) {}

TEST_F(AutofillProfileComparatorTest, NormalizeForComparison) {}

TEST_F(AutofillProfileComparatorTest, GetNamePartVariants) {}

TEST_F(AutofillProfileComparatorTest, IsNameVariantOf) {}

TEST_F(AutofillProfileComparatorTest, HaveMergeableNames) {}

TEST_F(AutofillProfileComparatorTest, HaveMergeableEmailAddresses) {}

TEST_F(AutofillProfileComparatorTest, HaveMergeableCompanyNames) {}

TEST_F(AutofillProfileComparatorTest, HaveMergeablePhoneNumbers) {}

TEST_F(AutofillProfileComparatorTest, HaveMergeableAddresses) {}

TEST_F(AutofillProfileComparatorTest, AreMergeable) {}

TEST_F(AutofillProfileComparatorTest, MergeNames_WithPermutation) {}

TEST_F(AutofillProfileComparatorTest, MergeNames) {}

TEST_F(AutofillProfileComparatorTest, MergeCJKNames) {}

TEST_F(AutofillProfileComparatorTest, MergeEmailAddresses) {}

TEST_F(AutofillProfileComparatorTest, MergeCompanyNames) {}

TEST_F(AutofillProfileComparatorTest, MergePhoneNumbers_NA) {}

TEST_F(AutofillProfileComparatorTest, MergePhoneNumbers_Intl) {}

TEST_F(AutofillProfileComparatorTest, MergeAddresses) {}

TEST_F(AutofillProfileComparatorTest, MergeAddressesMostUniqueTokens) {}

TEST_F(AutofillProfileComparatorTest, MergeAddressesWithStructure) {}

TEST_F(AutofillProfileComparatorTest, MergeAddressesWithRewrite) {}

// The intention of this test is to verify that "Straße" and "Str."" ar
// considered equivalent, which requires a normalization of ß to ss followed by
// a rewrite of "strasse" to "str".
TEST_F(AutofillProfileComparatorTest, MergeAddressesWithRewriteDE) {}

TEST_F(AutofillProfileComparatorTest,
       MergeAddressesDependentLocalityAndSortingCode) {}

TEST_F(AutofillProfileComparatorTest, MergeLandmarkAndBetweenStreetsAndAdmin2) {}

// Checks for various scenarios for determining mergability of profiles w.r.t.
// the state.
TEST_F(AutofillProfileComparatorTest, CheckStatesMergability) {}

// Tests if determining if two profiles have at least one different settings
// visible value works.
TEST_F(AutofillProfileComparatorTest,
       ProfilesHaveDifferentSettingsVisibleValues) {}

TEST_F(AutofillProfileComparatorTest, GetProfileDifference) {}

TEST_F(AutofillProfileComparatorTest, GetProfileDifferenceMap) {}

TEST_F(AutofillProfileComparatorTest, GetSettingsVisibleProfileDifference) {}

TEST_F(AutofillProfileComparatorTest, GetSettingsVisibleProfileDifferenceMap) {}

TEST_F(AutofillProfileComparatorTest, IsMergeCandidate) {}

// Tests that the profiles are merged when they have common states.
TEST_F(AutofillProfileComparatorTest, MergeProfilesBasedOnState) {}

// Tests that when `NonMergeableSettingVisibleTypes()` is called with two
// profiles of the same country, differing in `differing_types`, the function
// returns `expected_setting_visible_difference`.
struct NonMergeableSettingVisibleTypesTestCase {};

class NonMergeableSettingVisibleTypesTest
    : public AutofillProfileComparatorTest,
      public testing::WithParamInterface<
          NonMergeableSettingVisibleTypesTestCase> {};

TEST_P(NonMergeableSettingVisibleTypesTest, DifferingTypes) {}

INSTANTIATE_TEST_SUITE_P();

// Test that types with mergeable values are not returned by
// `NonMergeableSettingVisibleTypes()`.
TEST_F(AutofillProfileComparatorTest,
       NonMergeableSettingVisibleTypes_Mergeability) {}

// Tests that `NonMergeableSettingVisibleTypes()` is nullopt for profiles of
// differing countries.
TEST_F(AutofillProfileComparatorTest,
       NonMergeableSettingVisibleTypes_DifferentCountry) {}

}  // namespace

}  // namespace autofill