#include "components/autofill/core/browser/data_model/autofill_structured_address_component.h"
#include <map>
#include <string>
#include <vector>
#include "base/strings/utf_string_conversions.h"
#include "base/test/gtest_util.h"
#include "base/test/scoped_feature_list.h"
#include "components/autofill/core/browser/autofill_type.h"
#include "components/autofill/core/browser/data_model/autofill_i18n_api.h"
#include "components/autofill/core/browser/data_model/autofill_structured_address_component_test_api.h"
#include "components/autofill/core/browser/data_model/autofill_structured_address_name.h"
#include "components/autofill/core/browser/data_model/autofill_structured_address_test_utils.h"
#include "components/autofill/core/browser/data_model/autofill_structured_address_utils.h"
#include "components/autofill/core/browser/field_types.h"
#include "components/autofill/core/common/autofill_features.h"
#include "testing/gtest/include/gtest/gtest.h"
ASCIIToUTF16;
UTF8ToUTF16;
namespace autofill {
AddressComponentTestValues;
class TestAtomicFirstNameAddressComponent : public AddressComponent { … };
class TestAtomicMiddleNameAddressComponent : public AddressComponent { … };
class TestAtomicLastNameAddressComponent : public AddressComponent { … };
class TestCompoundNameAddressComponent : public AddressComponent { … };
class TestCompoundNameRegExParsedAddressComponent : public AddressComponent { … };
class TestCompoundNameCustomFormatAddressComponent : public AddressComponent { … };
class TestCompoundNameCustomAffixedFormatAddressComponent
: public AddressComponent { … };
class TestCompoundNameWithTitleAddressComponent : public AddressComponent { … };
class TestNonProperFirstNameAddressComponent : public AddressComponent { … };
void TestAtomMerging(FieldType type,
AddressComponentTestValues older_values,
AddressComponentTestValues newer_values,
AddressComponentTestValues merge_expectation,
bool is_mergeable,
int merge_modes,
bool newer_was_more_recently_used = true) { … }
void TestCompoundNameMerging(AddressComponentTestValues older_values,
AddressComponentTestValues newer_values,
AddressComponentTestValues merge_expectation,
bool is_mergeable,
int merge_modes,
bool newer_was_more_recently_used = true) { … }
class AutofillStructuredAddressAddressComponent : public testing::Test { … };
TEST_F(AutofillStructuredAddressAddressComponent, ConstructAndDestruct) { … }
TEST_F(AutofillStructuredAddressAddressComponent,
TestNonProperTreeDcheckFailure) { … }
TEST_F(AutofillStructuredAddressAddressComponent, TestGetRootNode) { … }
TEST_F(AutofillStructuredAddressAddressComponent, TestGetSupportedFieldType) { … }
TEST_F(AutofillStructuredAddressAddressComponent, TestSetFieldTypeValue) { … }
TEST_F(AutofillStructuredAddressAddressComponent, TestGetFieldTypeValue) { … }
TEST_F(AutofillStructuredAddressAddressComponent,
TestGetValueForComparisonForType) { … }
TEST_F(AutofillStructuredAddressAddressComponent, TestGetSupportedTypes) { … }
TEST_F(AutofillStructuredAddressAddressComponent, TestGetStorableTypes) { … }
TEST_F(AutofillStructuredAddressAddressComponent, TestComparison_Atom) { … }
TEST_F(AutofillStructuredAddressAddressComponent,
TestComparisonOperator_DifferentTypes) { … }
TEST_F(AutofillStructuredAddressAddressComponent,
TestComparisonOperator_SelfComparison) { … }
TEST_F(AutofillStructuredAddressAddressComponent, TestComparison_Compound) { … }
TEST_F(AutofillStructuredAddressAddressComponent, TestAssignmentOperator_Atom) { … }
TEST_F(AutofillStructuredAddressAddressComponent,
TestAssignmentOperator_Compound_FromBase) { … }
TEST_F(AutofillStructuredAddressAddressComponent,
TestAssignmentOperator_Compound) { … }
TEST_F(AutofillStructuredAddressAddressComponent, SelfAssignment) { … }
TEST_F(AutofillStructuredAddressAddressComponent, GetStorageType) { … }
TEST_F(AutofillStructuredAddressAddressComponent, GetStorageTypeName) { … }
TEST_F(AutofillStructuredAddressAddressComponent, GetAtomicity) { … }
TEST_F(AutofillStructuredAddressAddressComponent, DirectlyGetSetAndUnsetValue) { … }
TEST_F(AutofillStructuredAddressAddressComponent,
RecursivelySettingAndGettingValues) { … }
TEST_F(AutofillStructuredAddressAddressComponent, GetSubcomponentTypes) { … }
TEST_F(AutofillStructuredAddressAddressComponent, GetBestFormatString_ForAtom) { … }
TEST_F(AutofillStructuredAddressAddressComponent,
GetBestFormatString_WithFallback) { … }
TEST_F(AutofillStructuredAddressAddressComponent,
GetBestFormatString_WithCustomMethod) { … }
TEST_F(AutofillStructuredAddressAddressComponent,
FormatValueFromSubcomponents) { … }
class TestCompoundNameAddressComponentCustomFormatSeparator
: public AddressComponent { … };
TEST_F(AutofillStructuredAddressAddressComponent,
FormatValueFromSubcomponentsSeparators) { … }
class TestCompoundNameAddressComponentCustomFormatNewLineSeparator
: public AddressComponent { … };
TEST_F(AutofillStructuredAddressAddressComponent,
FormatValueFromSubcomponentsNewLineSeparators) { … }
TEST_F(AutofillStructuredAddressAddressComponent,
FormatAndTrimValueFromSubcomponents) { … }
TEST_F(AutofillStructuredAddressAddressComponent,
TestEquivalenceOfReplacePlaceholderImplementations) { … }
TEST_F(AutofillStructuredAddressAddressComponent,
FormatValueFromSubcomponentsWithTypeSpecificFormat) { … }
TEST_F(AutofillStructuredAddressAddressComponent,
FormatValueFromSubcomponentsWithTypeSpecificAffixedFormat) { … }
TEST_F(AutofillStructuredAddressAddressComponent,
TestParseValueAndAssignSubcomponentsByFallbackMethod_EmptyString) { … }
TEST_F(AutofillStructuredAddressAddressComponent,
TestParseValueAndAssignSubcomponentsByRegEx) { … }
TEST_F(AutofillStructuredAddressAddressComponent,
TestParseValueAndAssignSubcomponentsByFallbackMethod_Atom) { … }
TEST_F(AutofillStructuredAddressAddressComponent,
TestParseValueAndAssignSubcomponentsByFallbackMethod) { … }
TEST_F(AutofillStructuredAddressAddressComponent,
ParseValueAndAssignSubcomponentsByFallbackMethod_WithFewTokens) { … }
TEST_F(AutofillStructuredAddressAddressComponent, IsTreeCompletable) { … }
TEST_F(AutofillStructuredAddressAddressComponent, TreeCompletion_TopToBottom) { … }
TEST_F(AutofillStructuredAddressAddressComponent, TreeCompletion_BottomToTop) { … }
TEST_F(AutofillStructuredAddressAddressComponent,
TreeCompletion_ToTopAndBottom) { … }
TEST_F(AutofillStructuredAddressAddressComponent,
TestSettingsValuesWithInvalidation) { … }
TEST_F(AutofillStructuredAddressAddressComponent,
TestUnsettingAValueAndItsSubcomponents) { … }
TEST_F(AutofillStructuredAddressAddressComponent,
TestUnsettingParsedAndFormattedValues) { … }
TEST_F(AutofillStructuredAddressAddressComponent,
MergeAtomicComponentsWithDifferentValues) { … }
TEST_F(AutofillStructuredAddressAddressComponent,
MergeAtomicComponentsWithSameValue) { … }
TEST_F(AutofillStructuredAddressAddressComponent,
MergeAtomicComponentsSimilarValueThatContainsSameNormalizedValue) { … }
TEST_F(AutofillStructuredAddressAddressComponent,
MergeAtomicComponentsWithPermutedValue) { … }
TEST_F(AutofillStructuredAddressAddressComponent, MergeVerificationStatuses) { … }
TEST_F(AutofillStructuredAddressAddressComponent,
ClearParsedAndFormattedValues) { … }
TEST_F(AutofillStructuredAddressAddressComponent,
MergeTriviallyMergeableCompoundComponents) { … }
TEST_F(AutofillStructuredAddressAddressComponent, MergePermutedComponent) { … }
TEST_F(AutofillStructuredAddressAddressComponent,
SimpleReplacementBasedMergingStrategies) { … }
TEST_F(AutofillStructuredAddressAddressComponent, MergeChildsAndReformatRoot) { … }
TEST_F(AutofillStructuredAddressAddressComponent,
TestIsLessSignificantVerificationStatus) { … }
TEST_F(AutofillStructuredAddressAddressComponent,
GetMoreSignificantVerificationStatus) { … }
TEST_F(AutofillStructuredAddressAddressComponent,
TestUseBetterOfMoreRecentIfDifferentMergeStrategy) { … }
TEST_F(AutofillStructuredAddressAddressComponent, TestFillTreeGaps) { … }
TEST_F(AutofillStructuredAddressAddressComponent,
IsValueCompatibleWithAncestorsCompatible) { … }
TEST_F(AutofillStructuredAddressAddressComponent, TestFillTreeGapsParsing) { … }
}