#include <stddef.h>
#include <memory>
#include <optional>
#include <string>
#include <vector>
#include "base/containers/flat_map.h"
#include "base/containers/span.h"
#include "base/feature_list.h"
#include "base/ranges/algorithm.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/task_environment.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "components/autofill/core/browser/autofill_field.h"
#include "components/autofill/core/browser/autofill_form_test_utils.h"
#include "components/autofill/core/browser/autofill_test_utils.h"
#include "components/autofill/core/browser/browser_autofill_manager.h"
#include "components/autofill/core/browser/browser_autofill_manager_test_api.h"
#include "components/autofill/core/browser/data_model/autofill_profile.h"
#include "components/autofill/core/browser/data_model/credit_card.h"
#include "components/autofill/core/browser/field_types.h"
#include "components/autofill/core/browser/filling_product.h"
#include "components/autofill/core/browser/form_structure_test_api.h"
#include "components/autofill/core/browser/geo/alternative_state_name_map_test_utils.h"
#include "components/autofill/core/browser/heuristic_source.h"
#include "components/autofill/core/browser/payments/credit_card_cvc_authenticator.h"
#include "components/autofill/core/browser/payments/payments_autofill_client.h"
#include "components/autofill/core/browser/test_autofill_client.h"
#include "components/autofill/core/browser/test_autofill_driver.h"
#include "components/autofill/core/browser/test_browser_autofill_manager.h"
#include "components/autofill/core/common/autofill_clock.h"
#include "components/autofill/core/common/autofill_features.h"
#include "components/autofill/core/common/autofill_payments_features.h"
#include "components/autofill/core/common/autofill_test_utils.h"
#include "components/autofill/core/common/autofill_util.h"
#include "components/autofill/core/common/credit_card_network_identifiers.h"
#include "components/autofill/core/common/form_data.h"
#include "components/autofill/core/common/form_data_test_api.h"
#include "components/autofill/core/common/form_field_data.h"
#include "components/autofill/core/common/mojom/autofill_types.mojom-shared.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/abseil-cpp/absl/types/variant.h"
namespace autofill {
namespace …
class FormFillerTest : public testing::Test { … };
TEST_F(FormFillerTest, FillingDetails_FieldTypesToFill_FillOnlySpecificFields) { … }
TEST_F(FormFillerTest, FillTriggeredSection) { … }
TEST_F(FormFillerTest, DoNotFillIfFormFieldChanged) { … }
TEST_F(FormFillerTest, DoNotFillIfFormChanged) { … }
TEST_F(FormFillerTest, SkipFillIfFieldIsMeaningfullyPreFilled) { … }
TEST_F(FormFillerTest, SkipAllPreFilledFieldsExceptIfFieldIsAPlaceholder) { … }
TEST_F(FormFillerTest, UndoSavesFormFillingData) { … }
TEST_F(FormFillerTest, UndoSavesFieldByFieldFillingData) { … }
TEST_F(FormFillerTest, UndoResetsCachedAutofillState) { … }
TEST_F(FormFillerTest, FillOrPreviewDataModelFormCallsDidFillOrPreviewForm) { … }
TEST_F(FormFillerTest,
FillAddressForm_AutocompleteUnrecognizedFillingBehavior) { … }
TEST_F(FormFillerTest, FillCreditCardForm_Simple) { … }
TEST_F(FormFillerTest, FillCreditCardForm_StripCardNumber) { … }
struct PartialCreditCardDateParams { … };
class PartialCreditCardDateTest
: public FormFillerTest,
public testing::WithParamInterface<PartialCreditCardDateParams> { … };
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(PartialCreditCardDateTest, FillWithPartialDate) { … }
TEST_F(FormFillerTest, FillOnlyFirstNineteenCreditCardNumberFields) { … }
TEST_F(FormFillerTest, FillCreditCardNumberIntoSingleDigitFields) { … }
TEST_F(FormFillerTest, FillCreditCardForm_SplitName) { … }
TEST_F(FormFillerTest, OnlyCountFilledSelectionBoxesForTypeFillingLimit) { … }
TEST_F(FormFillerTest, FillAddressForm_AutocompleteOffFillingBehavior) { … }
TEST_F(FormFillerTest, FillAddressForm_PlaceholderEqualsValue) { … }
TEST_F(FormFillerTest,
FillCreditCardForm_AutocompleteUnrecognizedFillingBehavior) { … }
TEST_F(FormFillerTest, FillCreditCardForm_AutocompleteOffBehavior) { … }
TEST_F(FormFillerTest, FillCreditCardForm_ExpiredCard) { … }
TEST_F(FormFillerTest, PreviewCreditCardForm_VirtualCard) { … }
TEST_F(FormFillerTest, DoNotFillUnfocusableFieldsExceptForSelect) { … }
TEST_F(FormFillerTest, FillFormWithAuthorSpecifiedSections) { … }
TEST_F(FormFillerTest, FillFormWithMultipleEmails) { … }
TEST_F(FormFillerTest, FillAutofilledAddressForm) { … }
TEST_F(FormFillerTest, FillAutofilledCreditCardForm) { … }
TEST_F(FormFillerTest, FillPartlyManuallyFilledAddressForm) { … }
TEST_F(FormFillerTest, FillPartlyManuallyFilledCreditCardForm) { … }
TEST_F(FormFillerTest, FillPhoneNumber) { … }
TEST_F(FormFillerTest, FillPhoneNumber_ForPhonePrefixOrSuffix) { … }
TEST_F(FormFillerTest, FillPhoneNumber_WithMaxLengthLimit) { … }
TEST_F(FormFillerTest, FillFirstPhoneNumber_ComponentizedNumbers) { … }
TEST_F(FormFillerTest, FillFirstPhoneNumber_WholeNumbers) { … }
TEST_F(FormFillerTest, FillFirstPhoneNumber_FillPartsOnceOnly) { … }
TEST_F(FormFillerTest, FillFirstPhoneNumber_NotFillMisclassifiedExtention) { … }
TEST_F(FormFillerTest, FillFirstPhoneNumber_BestEffortFilling) { … }
TEST_F(FormFillerTest, FillFirstPhoneNumber_FocusOnSecondPhoneNumber) { … }
TEST_F(FormFillerTest, FillFirstPhoneNumber_HiddenFieldShouldNotCount) { … }
TEST_F(FormFillerTest, FormWithHiddenOrPresentationalFields) { … }
TEST_F(FormFillerTest, FillFirstPhoneNumber_MultipleSectionFilledCorrectly) { … }
TEST_F(FormFillerTest, FormChangesRemoveField) { … }
TEST_F(FormFillerTest, FormChangesAddField) { … }
TEST_F(FormFillerTest, FormChangesVisibilityOfFields) { … }
TEST_F(FormFillerTest, FillInUpdatedExpirationDate) { … }
TEST_F(FormFillerTest, TrackFillingOrigin) { … }
TEST_F(FormFillerTest, TrackFillingOriginWithUsingMultipleProfiles) { … }
TEST_F(FormFillerTest, TrackFillingOriginOnEditedField) { … }
TEST_F(FormFillerTest, PreFilledCCFieldInAddressFormDoesNotCauseCrash) { … }
TEST_F(FormFillerTest, FillOrPreviewFormExperimental) { … }
struct RefillTestCase { … };
class ExpirationDateRefillTest
: public FormFillerTest,
public testing::WithParamInterface<RefillTestCase> { … };
TEST_P(ExpirationDateRefillTest, RefillJavascriptModifiedExpirationDates) { … }
INSTANTIATE_TEST_SUITE_P(…);
}