chromium/ios/chrome/browser/autofill/model/BUILD.gn

# 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.

source_set("model") {
  sources = [
    "address_normalizer_factory.h",
    "address_normalizer_factory.mm",
    "autocomplete_history_manager_factory.h",
    "autocomplete_history_manager_factory.mm",
    "autofill_image_fetcher_factory.h",
    "autofill_image_fetcher_factory.mm",
    "autofill_image_fetcher_impl.h",
    "autofill_image_fetcher_impl.mm",
    "autofill_log_router_factory.cc",
    "autofill_log_router_factory.h",
    "form_input_suggestions_provider.h",
    "form_suggestion_controller.h",
    "form_suggestion_controller.mm",
    "form_suggestion_tab_helper.h",
    "form_suggestion_tab_helper.mm",
    "personal_data_manager_factory.h",
    "personal_data_manager_factory.mm",
    "strike_database_factory.h",
    "strike_database_factory.mm",
    "validation_rules_storage_factory.cc",
    "validation_rules_storage_factory.h",
  ]
  deps = [
    ":model_shared",
    "//base",
    "//base:i18n",
    "//components/autofill/core/browser",
    "//components/autofill/ios/browser",
    "//components/autofill/ios/form_util",
    "//components/image_fetcher/core",
    "//components/image_fetcher/ios",
    "//components/keyed_service/core",
    "//components/keyed_service/ios",
    "//components/leveldb_proto",
    "//components/plus_addresses:features",
    "//components/prefs",
    "//components/sync/service",
    "//components/variations/service",
    "//ios/chrome/browser/autofill/resources",
    "//ios/chrome/browser/history/model",
    "//ios/chrome/browser/shared/model/application_context",
    "//ios/chrome/browser/shared/model/browser_state",
    "//ios/chrome/browser/shared/model/paths",
    "//ios/chrome/browser/shared/model/prefs:pref_names",
    "//ios/chrome/browser/shared/model/profile",
    "//ios/chrome/browser/shared/public/features",
    "//ios/chrome/browser/shared/ui/symbols",
    "//ios/chrome/browser/shared/ui/util:util_swift",
    "//ios/chrome/browser/shared/ui/util/image",
    "//ios/chrome/browser/signin/model",
    "//ios/chrome/browser/sync/model",
    "//ios/chrome/browser/webdata_services/model",
    "//ios/chrome/common/ui/colors:colors",
    "//ios/web/common",
    "//ios/web/public/js_messaging",
    "//third_party/leveldatabase",
    "//third_party/libaddressinput",
    "//ui/base",
    "//url",
  ]
  public_deps = [ ":constants" ]
  frameworks = [ "QuartzCore.framework" ]
}

source_set("model_shared") {
  sources = [
    "form_input_accessory_view_handler.h",
    "form_input_accessory_view_handler.mm",
    "form_input_navigator.h",
    "form_input_suggestions_provider.h",
    "form_suggestion_client.h",
  ]
  deps = [
    "//base",
    "//components/autofill/core/browser",
    "//components/autofill/ios/browser",
    "//ios/chrome/browser/shared/public/features",
    "//ios/chrome/browser/shared/ui/util",
    "//ios/web/public",
    "//ios/web/public/js_messaging",
  ]
  frameworks = [ "UIKit.framework" ]
}

source_set("model_internal") {
  sources = [
    "autofill_tab_helper.h",
    "autofill_tab_helper.mm",
  ]
  deps = [
    ":model",
    "//base",
    "//components/autofill/core/browser",
    "//components/autofill/core/common",
    "//components/autofill/ios/browser",
    "//components/autofill/ios/form_util:child_frame_registrar",
    "//components/infobars/core",
    "//components/pref_registry",
    "//components/prefs",
    "//ios/chrome/browser/autofill/ui_bundled:coordinator",
    "//ios/chrome/browser/infobars/model",
    "//ios/chrome/browser/shared/model/application_context",
    "//ios/chrome/browser/shared/model/browser_state",
    "//ios/chrome/browser/shared/model/profile",
    "//ios/chrome/browser/shared/public/commands:commands",
    "//ios/chrome/browser/signin/model",
    "//third_party/leveldatabase",
    "//ui/gfx/geometry",
    "//url",
  ]
  frameworks = [ "UIKit.framework" ]
}

source_set("constants") {
  sources = [
    "form_suggestion_constants.h",
    "form_suggestion_constants.mm",
  ]
}

# This file defines the autofill_test_files list, which contains all input
# and output files for form_structure_browsertest.mm.
import("//components/test/data/autofill/heuristics/test_files.gni")

# Generate a file containing the list of test input files. This list will
# be used to initialise the test as enumerating the file in the bundle is
# problematic when doing an incremental build (as deleting test files from
# autofill_test_files does not remove them from the generated test app
# bundle).
write_file(
    "${root_gen_dir}/autofill_browsertest/autofill_test_files",
    rebase_path(filter_include(
                    autofill_test_files,
                    [ "//components/test/data/autofill/heuristics/input/*" ]),
                "//components/test/data/autofill/heuristics/input",
                "."))

source_set("unit_tests") {
  testonly = true

  sources = [
    "autofill_controller_js_unittest.mm",
    "autofill_controller_unittest.mm",
    "autofill_image_fetcher_impl_unittest.mm",
    "autofill_java_script_feature_unittest.mm",
    "child_frame_registration_js_unittest.mm",
    "form_input_accessory_view_handler_unittest.mm",
    "form_structure_browsertest.mm",
    "form_suggestion_controller_unittest.mm",
    "suggestion_controller_java_script_feature_unittest.mm",
  ]
  deps = [
    ":model",
    ":model_internal",
    ":model_shared",
    ":unit_tests_bundle_data",
    ":unit_tests_bundle_data_list",
    "//base",
    "//base/test:test_support",
    "//components/autofill/core/browser",
    "//components/autofill/core/browser:test_support",
    "//components/autofill/core/common",
    "//components/autofill/ios/browser",
    "//components/autofill/ios/browser:test_support",
    "//components/autofill/ios/browser:util",
    "//components/autofill/ios/common",
    "//components/autofill/ios/form_util",
    "//components/autofill/ios/form_util:child_frame_registration_test_ts",
    "//components/autofill/ios/form_util:form_util_feature",
    "//components/autofill/ios/form_util:test_support",
    "//components/feature_engagement/public",
    "//components/feature_engagement/test:test_support",
    "//components/infobars/core",
    "//components/keyed_service/core",
    "//components/password_manager/core/browser:test_support",
    "//components/password_manager/ios",
    "//components/plus_addresses:features",
    "//components/security_state/ios",
    "//components/sync_user_events:test_support",
    "//ios/chrome/app/application_delegate:app_state_header",
    "//ios/chrome/browser/autofill/ui_bundled:coordinator",
    "//ios/chrome/browser/autofill/ui_bundled/form_input_accessory",
    "//ios/chrome/browser/infobars/model",
    "//ios/chrome/browser/passwords/model",
    "//ios/chrome/browser/shared/coordinator/chrome_coordinator",
    "//ios/chrome/browser/shared/model/application_context",
    "//ios/chrome/browser/shared/model/paths",
    "//ios/chrome/browser/shared/model/profile/test",
    "//ios/chrome/browser/shared/public/features",
    "//ios/chrome/browser/ssl/model",
    "//ios/chrome/browser/sync/model:model",
    "//ios/chrome/browser/ui/settings:test_support",
    "//ios/chrome/browser/web/model:web_internal",
    "//ios/chrome/browser/webdata_services/model",
    "//ios/chrome/test:test_support",
    "//ios/testing:block_swizzler",
    "//ios/web/public/js_messaging",
    "//ios/web/public/test",
    "//ios/web/public/test:javascript_test",
    "//testing/data_driven_testing",
    "//testing/gtest",
    "//third_party/leveldatabase",
    "//third_party/ocmock",
    "//ui/base:test_support",
    "//ui/gfx:test_support",
  ]
}

bundle_data("unit_tests_bundle_data") {
  sources = autofill_test_files
  outputs = [ "{{bundle_resources_dir}}/" +
              "{{source_root_relative_dir}}/{{source_file_part}}" ]
}

bundle_data("unit_tests_bundle_data_list") {
  sources = [ "${root_gen_dir}/autofill_browsertest/autofill_test_files" ]
  outputs =
      [ "{{bundle_resources_dir}}/" +
        "components/test/data/autofill/heuristics/input/{{source_file_part}}" ]
}

source_set("eg2_tests") {
  configs += [ "//build/config/ios:xctest_config" ]
  testonly = true
  sources = [ "form_input_egtest.mm" ]
  deps = [
    "//base",
    "//base/test:test_support",
    "//ios/chrome/app/strings",
    "//ios/chrome/browser/autofill/ui_bundled:eg_test_support+eg2",
    "//ios/chrome/test:eg_test_support+eg2",
    "//ios/chrome/test/earl_grey:eg_test_support+eg2",
    "//ios/testing/earl_grey:eg_test_support+eg2",
    "//ios/web/public",
    "//ios/web/public/test:element_selector",
    "//net:test_support",
  ]
  frameworks = [ "UIKit.framework" ]
}