naiveproxy/components/autofill/core/browser/BUILD.gn
2018-08-14 22:19:20 +00:00

572 lines
18 KiB
Plaintext

# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/chrome_build.gni")
import("//build/config/jumbo.gni")
import("//testing/libfuzzer/fuzzer_test.gni")
jumbo_static_library("browser") {
sources = [
"address.cc",
"address.h",
"address_combobox_model.cc",
"address_combobox_model.h",
"address_field.cc",
"address_field.h",
"address_i18n.cc",
"address_i18n.h",
"address_normalization_manager.cc",
"address_normalization_manager.h",
"address_normalizer.h",
"address_normalizer_impl.cc",
"address_normalizer_impl.h",
"address_rewriter.cc",
"address_rewriter.h",
"address_rewriter_rules.cc",
"autocomplete_history_manager.cc",
"autocomplete_history_manager.h",
"autofill-inl.h",
"autofill_address_util.cc",
"autofill_address_util.h",
"autofill_client.h",
"autofill_country.cc",
"autofill_country.h",
"autofill_data_model.cc",
"autofill_data_model.h",
"autofill_data_util.cc",
"autofill_data_util.h",
"autofill_download_manager.cc",
"autofill_download_manager.h",
"autofill_driver.h",
"autofill_driver_factory.cc",
"autofill_driver_factory.h",
"autofill_experiments.cc",
"autofill_experiments.h",
"autofill_external_delegate.cc",
"autofill_external_delegate.h",
"autofill_field.cc",
"autofill_field.h",
"autofill_handler.cc",
"autofill_handler.h",
"autofill_handler_proxy.cc",
"autofill_handler_proxy.h",
"autofill_ie_toolbar_import_win.cc",
"autofill_ie_toolbar_import_win.h",
"autofill_manager.cc",
"autofill_manager.h",
"autofill_manager_test_delegate.h",
"autofill_metrics.cc",
"autofill_metrics.h",
"autofill_popup_delegate.h",
"autofill_profile.cc",
"autofill_profile.h",
"autofill_profile_comparator.cc",
"autofill_profile_comparator.h",
"autofill_profile_sync_util.cc",
"autofill_profile_sync_util.h",
"autofill_profile_validation_util.cc",
"autofill_profile_validation_util.h",
"autofill_profile_validator.cc",
"autofill_profile_validator.h",
"autofill_provider.cc",
"autofill_provider.h",
"autofill_scanner.cc",
"autofill_scanner.h",
"autofill_type.cc",
"autofill_type.h",
"autofill_wallet_data_type_controller.cc",
"autofill_wallet_data_type_controller.h",
"card_unmask_delegate.cc",
"card_unmask_delegate.h",
"contact_info.cc",
"contact_info.h",
"country_combobox_model.cc",
"country_combobox_model.h",
"country_data.cc",
"country_data.h",
"country_names.cc",
"country_names.h",
"credit_card.cc",
"credit_card.h",
"credit_card_field.cc",
"credit_card_field.h",
"credit_card_save_manager.cc",
"credit_card_save_manager.h",
"email_field.cc",
"email_field.h",
"field_candidates.cc",
"field_candidates.h",
"field_filler.cc",
"field_filler.h",
"field_types.h",
"form_data_importer.cc",
"form_data_importer.h",
"form_field.cc",
"form_field.h",
"form_group.cc",
"form_group.h",
"form_structure.cc",
"form_structure.h",
"form_types.cc",
"form_types.h",
"legal_message_line.cc",
"legal_message_line.h",
"local_card_migration_manager.cc",
"local_card_migration_manager.h",
"name_field.cc",
"name_field.h",
"password_generator.cc",
"password_generator.h",
"password_requirements_spec_fetcher.h",
"password_requirements_spec_fetcher_impl.cc",
"password_requirements_spec_fetcher_impl.h",
"password_requirements_spec_printer.cc",
"password_requirements_spec_printer.h",
"payments/full_card_request.cc",
"payments/full_card_request.h",
"payments/payments_client.cc",
"payments/payments_client.h",
"payments/payments_request.h",
"payments/payments_service_url.cc",
"payments/payments_service_url.h",
"personal_data_manager.cc",
"personal_data_manager.h",
"personal_data_manager_observer.h",
"phone_field.cc",
"phone_field.h",
"phone_number.cc",
"phone_number.h",
"phone_number_i18n.cc",
"phone_number_i18n.h",
"popup_item_ids.h",
"popup_types.h",
"rationalization_util.cc",
"rationalization_util.h",
"region_combobox_model.cc",
"region_combobox_model.h",
"region_data_loader.h",
"region_data_loader_impl.cc",
"region_data_loader_impl.h",
"risk_data_loader.h",
"search_field.cc",
"search_field.h",
"state_names.cc",
"state_names.h",
"subkey_requester.cc",
"subkey_requester.h",
"suggestion.cc",
"suggestion.h",
"ui/card_unmask_prompt_controller.h",
"ui/card_unmask_prompt_controller_impl.cc",
"ui/card_unmask_prompt_controller_impl.h",
"ui/card_unmask_prompt_view.h",
"validation.cc",
"validation.h",
"webdata/autocomplete_sync_bridge.cc",
"webdata/autocomplete_sync_bridge.h",
"webdata/autofill_change.cc",
"webdata/autofill_change.h",
"webdata/autofill_entry.cc",
"webdata/autofill_entry.h",
"webdata/autofill_profile_data_type_controller.cc",
"webdata/autofill_profile_data_type_controller.h",
"webdata/autofill_profile_sync_bridge.cc",
"webdata/autofill_profile_sync_bridge.h",
"webdata/autofill_profile_sync_difference_tracker.cc",
"webdata/autofill_profile_sync_difference_tracker.h",
"webdata/autofill_profile_syncable_service.cc",
"webdata/autofill_profile_syncable_service.h",
"webdata/autofill_sync_bridge_util.cc",
"webdata/autofill_sync_bridge_util.h",
"webdata/autofill_table.cc",
"webdata/autofill_table.h",
"webdata/autofill_table_encryptor.h",
"webdata/autofill_table_encryptor_factory.cc",
"webdata/autofill_table_encryptor_factory.h",
"webdata/autofill_wallet_metadata_sync_bridge.cc",
"webdata/autofill_wallet_metadata_sync_bridge.h",
"webdata/autofill_wallet_metadata_syncable_service.cc",
"webdata/autofill_wallet_metadata_syncable_service.h",
"webdata/autofill_wallet_sync_bridge.cc",
"webdata/autofill_wallet_sync_bridge.h",
"webdata/autofill_wallet_syncable_service.cc",
"webdata/autofill_wallet_syncable_service.h",
"webdata/autofill_webdata.h",
"webdata/autofill_webdata_backend.h",
"webdata/autofill_webdata_backend_impl.cc",
"webdata/autofill_webdata_backend_impl.h",
"webdata/autofill_webdata_service.cc",
"webdata/autofill_webdata_service.h",
"webdata/autofill_webdata_service_observer.h",
"webdata/system_encryptor.cc",
"webdata/system_encryptor.h",
]
if (is_ios) {
sources += [
"keyboard_accessory_metrics_logger.h",
"keyboard_accessory_metrics_logger.mm",
]
}
if (is_ios || is_android) {
sources += [
"autofill_assistant.cc",
"autofill_assistant.h",
"autofill_credit_card_filling_infobar_delegate_mobile.cc",
"autofill_credit_card_filling_infobar_delegate_mobile.h",
"autofill_save_card_infobar_delegate_mobile.cc",
"autofill_save_card_infobar_delegate_mobile.h",
"autofill_save_card_infobar_mobile.h",
]
}
if (!is_android) {
sources += [
"ui/local_card_migration_bubble_controller.h",
"ui/local_card_migration_dialog_controller.h",
"ui/save_card_bubble_controller.h",
]
}
if (!is_ios) {
sources += [
"autofill_address_policy_handler.cc",
"autofill_address_policy_handler.h",
"autofill_credit_card_policy_handler.cc",
"autofill_credit_card_policy_handler.h",
"autofill_policy_handler.cc",
"autofill_policy_handler.h",
]
}
configs += [ "//build/config:precompiled_headers" ]
public_deps = [
"//components/autofill/core/browser/proto",
"//components/autofill/core/common",
"//components/resources",
"//components/security_state/core",
"//skia",
"//third_party/libaddressinput",
]
deps = [
":password_generator_fips181",
"//base",
"//base:i18n",
"//components/data_use_measurement/core",
"//components/infobars/core",
"//components/keyed_service/core",
"//components/os_crypt",
"//components/pref_registry",
"//components/prefs",
"//components/signin/core/browser:signin_metrics",
"//components/strings",
"//components/sync",
"//components/variations/net",
"//components/version_info",
"//components/webdata/common",
"//google_apis",
"//net",
"//services/identity/public/cpp",
"//services/metrics/public/cpp:metrics_cpp",
"//services/metrics/public/cpp:ukm_builders",
"//services/network/public/cpp",
"//services/network/public/mojom",
"//sql",
"//third_party/icu",
"//third_party/libphonenumber",
"//third_party/re2",
"//ui/accessibility:accessibility",
"//ui/base",
"//ui/gfx",
"//ui/gfx/geometry",
"//ui/gfx/range",
"//url",
]
if (!is_ios) {
deps += [
"//components/policy/core/browser",
"//components/policy/core/common",
]
}
configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
}
jumbo_static_library("test_support") {
testonly = true
sources = [
"autofill_test_utils.cc",
"autofill_test_utils.h",
"data_driven_test.cc",
"data_driven_test.h",
"payments/test_payments_client.cc",
"payments/test_payments_client.h",
"suggestion_test_helpers.h",
"test_address_normalizer.cc",
"test_address_normalizer.h",
"test_autofill_client.cc",
"test_autofill_client.h",
"test_autofill_clock.cc",
"test_autofill_clock.h",
"test_autofill_download_manager.cc",
"test_autofill_download_manager.h",
"test_autofill_driver.cc",
"test_autofill_driver.h",
"test_autofill_external_delegate.cc",
"test_autofill_external_delegate.h",
"test_autofill_manager.cc",
"test_autofill_manager.h",
"test_autofill_provider.cc",
"test_autofill_provider.h",
"test_credit_card_save_manager.cc",
"test_credit_card_save_manager.h",
"test_event_waiter.h",
"test_form_data_importer.cc",
"test_form_data_importer.h",
"test_form_structure.cc",
"test_form_structure.h",
"test_local_card_migration_manager.cc",
"test_local_card_migration_manager.h",
"test_personal_data_manager.cc",
"test_personal_data_manager.h",
"test_region_data_loader.cc",
"test_region_data_loader.h",
"test_sync_service.cc",
"test_sync_service.h",
"webdata/autofill_sync_bridge_test_util.cc",
"webdata/autofill_sync_bridge_test_util.h",
]
public_deps = [
":browser",
]
deps = [
"//base",
"//base/test:test_support",
"//components/autofill/core/browser",
"//components/autofill/core/common",
"//components/os_crypt",
"//components/os_crypt:test_support",
"//components/pref_registry",
"//components/prefs:test_support",
"//components/sync",
"//components/sync:test_support_driver",
"//components/ukm",
"//components/ukm:test_support",
"//google_apis:test_support",
"//services/identity/public/cpp:test_support",
"//services/network:test_support",
"//services/network/public/cpp",
"//skia",
"//testing/gtest",
"//third_party/libaddressinput:util",
"//ui/gfx:test_support",
"//ui/gfx/geometry",
]
}
static_library("password_generator_fips181") {
sources = [
"password_generator_fips181.cc",
"password_generator_fips181.h",
]
deps = [
"//base",
"//third_party/fips181",
]
}
bundle_data("unit_tests_bundle_data") {
sources = [
"//components/test/data/autofill/merge/input/ambiguous.in",
"//components/test/data/autofill/merge/input/case.in",
"//components/test/data/autofill/merge/input/email.in",
"//components/test/data/autofill/merge/input/identical.in",
"//components/test/data/autofill/merge/input/primarycase.in",
"//components/test/data/autofill/merge/input/singlemerge.in",
"//components/test/data/autofill/merge/input/validation.in",
"//components/test/data/autofill/merge/output/ambiguous.out",
"//components/test/data/autofill/merge/output/case.out",
"//components/test/data/autofill/merge/output/email.out",
"//components/test/data/autofill/merge/output/identical.out",
"//components/test/data/autofill/merge/output/primarycase.out",
"//components/test/data/autofill/merge/output/singlemerge.out",
"//components/test/data/autofill/merge/output/validation.out",
]
outputs = [
"{{bundle_resources_dir}}/" +
"{{source_root_relative_dir}}/{{source_file_part}}",
]
}
source_set("unit_tests") {
testonly = true
sources = [
"address_combobox_model_unittest.cc",
"address_field_unittest.cc",
"address_i18n_unittest.cc",
"address_normalization_manager_unittest.cc",
"address_normalizer_impl_unittest.cc",
"address_rewriter_unittest.cc",
"address_unittest.cc",
"autocomplete_history_manager_unittest.cc",
"autofill_country_unittest.cc",
"autofill_data_model_unittest.cc",
"autofill_data_util_unittest.cc",
"autofill_download_manager_unittest.cc",
"autofill_driver_factory_unittest.cc",
"autofill_experiments_unittest.cc",
"autofill_external_delegate_unittest.cc",
"autofill_ie_toolbar_import_win_unittest.cc",
"autofill_manager_unittest.cc",
"autofill_merge_unittest.cc",
"autofill_metrics_unittest.cc",
"autofill_profile_comparator_unittest.cc",
"autofill_profile_sync_util_unittest.cc",
"autofill_profile_unittest.cc",
"autofill_profile_validation_util_unittest.cc",
"autofill_profile_validator_unittest.cc",
"autofill_type_unittest.cc",
"autofill_wallet_data_type_controller_unittest.cc",
"contact_info_unittest.cc",
"country_combobox_model_unittest.cc",
"country_names_unittest.cc",
"credit_card_field_unittest.cc",
"credit_card_save_manager_unittest.cc",
"credit_card_unittest.cc",
"field_candidates_unittest.cc",
"field_filler_unittest.cc",
"form_data_importer_unittest.cc",
"form_field_unittest.cc",
"form_structure_unittest.cc",
"legal_message_line_unittest.cc",
"local_card_migration_manager_unittest.cc",
"name_field_unittest.cc",
"password_generator_fips181_unittest.cc",
"password_generator_unittest.cc",
"password_requirements_spec_fetcher_unittest.cc",
"payments/full_card_request_unittest.cc",
"payments/payments_client_unittest.cc",
"payments/payments_service_url_unittest.cc",
"personal_data_manager_unittest.cc",
"phone_field_unittest.cc",
"phone_number_i18n_unittest.cc",
"phone_number_unittest.cc",
"rationalization_util_unittest.cc",
"region_combobox_model_unittest.cc",
"search_field_unittest.cc",
"subkey_requester_unittest.cc",
"ui/card_unmask_prompt_controller_impl_unittest.cc",
"validation_unittest.cc",
"webdata/autocomplete_sync_bridge_unittest.cc",
"webdata/autofill_profile_sync_bridge_unittest.cc",
"webdata/autofill_profile_sync_difference_tracker_unittest.cc",
"webdata/autofill_profile_syncable_service_unittest.cc",
"webdata/autofill_sync_bridge_util_unittest.cc",
"webdata/autofill_table_unittest.cc",
"webdata/autofill_wallet_metadata_sync_bridge_unittest.cc",
"webdata/autofill_wallet_metadata_syncable_service_unittest.cc",
"webdata/autofill_wallet_sync_bridge_unittest.cc",
"webdata/autofill_wallet_syncable_service_unittest.cc",
"webdata/web_data_service_unittest.cc",
]
if (is_ios || is_android) {
sources += [ "autofill_assistant_unittest.cc" ]
}
if (!is_ios) {
sources += [
"autofill_address_policy_handler_unittest.cc",
"autofill_credit_card_policy_handler_unittest.cc",
"autofill_policy_handler_unittest.cc",
]
}
deps = [
":browser",
":password_generator_fips181",
":test_support",
":unit_tests_bundle_data",
"//base",
"//base/test:test_support",
"//components/autofill/core/common",
"//components/os_crypt",
"//components/os_crypt:test_support",
"//components/prefs:test_support",
"//components/resources",
"//components/security_state/core",
"//components/strings",
"//components/sync",
"//components/sync:test_support_driver",
"//components/sync:test_support_model",
"//components/ukm",
"//components/ukm:test_support",
"//components/variations",
"//components/variations:test_support",
"//components/webdata/common",
"//components/webdata_services:test_support",
"//google_apis",
"//google_apis:test_support",
"//net:test_support",
"//services/identity/public/cpp:test_support",
"//services/metrics/public/cpp:ukm_builders",
"//services/network:test_support",
"//services/network/public/cpp",
"//sql",
"//testing/gmock",
"//testing/gtest",
"//third_party/libaddressinput:test_support",
"//third_party/libaddressinput:util",
"//third_party/libphonenumber",
"//ui/base",
"//url",
]
if (!is_ios) {
deps += [ "//components/policy/core/common" ]
}
}
fuzzer_test("form_structure_fuzzer") {
sources = [
"form_structure_fuzzer.cc",
]
deps = [
":browser",
"//base:base",
"//components/autofill/core/common:common",
]
seed_corpus = "form_structure_fuzzer_corpus"
dict = "form_structure_fuzzer.dict"
}
fuzzer_test("password_generator_fips181_fuzzer") {
sources = [
"password_generator_fips181_fuzzer.cc",
]
deps = [
":password_generator_fips181",
]
}
if (use_libfuzzer) {
fuzzer_test("form_structure_process_query_response_fuzzer") {
sources = [
"form_structure_process_query_response_fuzzer.cc",
]
deps = [
":browser",
"//base:base",
"//components/autofill/core/browser/proto",
"//components/autofill/core/common",
"//third_party/libprotobuf-mutator",
]
}
}