chromium/ios/chrome/test/earl_grey/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.

# This target is only used in routinely device checks. Thus, the target name is
# different from other EG2 tests.
source_set("device_check_eg2_tests") {
  configs += [ "//build/config/ios:xctest_config" ]
  testonly = true
  sources = [ "device_check_egtest.mm" ]
  deps = [
    ":eg_test_support+eg2",
    "//components/strings",
    "//ios/testing/earl_grey:eg_test_support+eg2",
    "//ios/web/public/test:element_selector",
    "//ui/base",
    "//url",
  ]
  frameworks = [ "UIKit.framework" ]
}

source_set("hooks") {
  testonly = true
  sources = [ "eg_tests_hook.mm" ]
  deps = [
    ":switches",
    "//base",
    "//components/password_manager/core/browser:test_support",
    "//components/password_manager/core/browser/sharing:test_support",
    "//components/password_manager/ios:fake_bulk_leak_check_service",
    "//components/policy/core/common:test_support",
    "//components/saved_tab_groups:core",
    "//components/saved_tab_groups:fake_tab_group_sync_service",
    "//components/saved_tab_groups:test_support",
    "//components/signin/internal/identity_manager",
    "//components/signin/internal/identity_manager:test_support",
    "//ios/chrome/app:tests_hook",
    "//ios/chrome/browser/drive/model:test_support",
    "//ios/chrome/browser/flags:system_flags",
    "//ios/chrome/browser/policy/model:test_support",
    "//ios/chrome/browser/saved_tab_groups/model",
    "//ios/chrome/browser/shared/model/browser",
    "//ios/chrome/browser/shared/public/features",
    "//ios/chrome/browser/shared/public/features:system_flags",
    "//ios/chrome/browser/signin/model:fake_system_identity",
    "//ios/chrome/browser/signin/model:fake_system_identity_manager",
    "//ios/chrome/browser/ui/authentication:eg_app_support+eg2",
    "//ios/chrome/browser/ui/tab_switcher/tab_grid/tab_groups:eg_app_support+eg2",
    "//ios/chrome/test/app:test_support",
    "//ios/chrome/test/providers/signin:trusted_vault",
  ]
}

source_set("eg_app_support+eg2") {
  configs += [ "//build/config/ios:xctest_config" ]
  testonly = true
  sources = [
    "accessibility_util.h",
    "accessibility_util.mm",
    "chrome_actions_app_interface.h",
    "chrome_actions_app_interface.mm",
    "chrome_earl_grey_app_interface.h",
    "chrome_earl_grey_app_interface.mm",
    "chrome_matchers_app_interface.h",
    "chrome_matchers_app_interface.mm",
    "chrome_test_case_app_interface.h",
    "chrome_test_case_app_interface.mm",
    "earl_grey_scoped_block_swizzler_app_interface.h",
    "earl_grey_scoped_block_swizzler_app_interface.mm",
  ]

  deps = [
    ":switches",
    "//base",
    "//base/test:test_support",
    "//components/autofill/core/browser",
    "//components/browsing_data/core",
    "//components/content_settings/core/browser",
    "//components/feature_engagement/public",
    "//components/metrics/demographics",
    "//components/password_manager/core/common",
    "//components/prefs",
    "//components/safe_browsing/core/common",
    "//components/search_engines",
    "//components/strings",
    "//components/sync:test_support",
    "//components/sync/base",
    "//components/translate/core/browser",
    "//components/unified_consent",
    "//components/variations",
    "//ios/chrome/app:app_internal",
    "//ios/chrome/app/strings",
    "//ios/chrome/browser/autofill/model",
    "//ios/chrome/browser/autofill/model/automation:eg_app_support+eg2",
    "//ios/chrome/browser/autofill/ui_bundled:eg_app_support+eg2",
    "//ios/chrome/browser/autofill/ui_bundled:ui",
    "//ios/chrome/browser/autofill/ui_bundled/form_input_accessory:eg_app_support+eg2",
    "//ios/chrome/browser/bookmarks/ui_bundled:constants",
    "//ios/chrome/browser/bookmarks/ui_bundled:eg_app_support+eg2",
    "//ios/chrome/browser/bring_android_tabs/ui_bundled:eg_app_support+eg2",
    "//ios/chrome/browser/content_settings/model:model",
    "//ios/chrome/browser/default_browser/model:test_support",
    "//ios/chrome/browser/default_browser/model:utils",
    "//ios/chrome/browser/device_sharing/model:eg_app_support+eg2",
    "//ios/chrome/browser/download/ui_bundled:constants",
    "//ios/chrome/browser/feature_engagement/model",
    "//ios/chrome/browser/find_bar/ui_bundled:eg_app_support+eg2",
    "//ios/chrome/browser/find_in_page/model",
    "//ios/chrome/browser/find_in_page/model:eg_app_support+eg2",
    "//ios/chrome/browser/first_run/model",
    "//ios/chrome/browser/first_run/ui_bundled:eg_app_support+eg2",
    "//ios/chrome/browser/first_run/ui_bundled:first_run_provider",
    "//ios/chrome/browser/first_run/ui_bundled:utils",
    "//ios/chrome/browser/first_run/ui_bundled/omnibox_position:eg_app_support+eg2",
    "//ios/chrome/browser/history/ui_bundled:constants",
    "//ios/chrome/browser/https_upgrades/model:eg_app_support+eg2",
    "//ios/chrome/browser/incognito_interstitial/ui_bundled:constants",
    "//ios/chrome/browser/location_bar/ui_bundled:constants",
    "//ios/chrome/browser/location_bar/ui_bundled:ui_bundled",
    "//ios/chrome/browser/metrics/model:eg_app_support+eg2",
    "//ios/chrome/browser/ntp/ui_bundled",
    "//ios/chrome/browser/optimization_guide/model:eg_app_support+eg2",
    "//ios/chrome/browser/passwords/model",
    "//ios/chrome/browser/passwords/model:eg_app_support+eg2",
    "//ios/chrome/browser/passwords/ui_bundled:eg_app_support+eg2",
    "//ios/chrome/browser/passwords/ui_bundled/bottom_sheet:eg_app_support+eg2",
    "//ios/chrome/browser/permissions/ui_bundled:eg_app_support+eg2",
    "//ios/chrome/browser/phone_number/ui_bundled:eg_app_support+eg2",
    "//ios/chrome/browser/plus_addresses/ui:eg_app_support+eg2",
    "//ios/chrome/browser/policy/model:eg_app_support+eg2",
    "//ios/chrome/browser/qr_scanner/ui_bundled:eg_app_support+eg2",
    "//ios/chrome/browser/safe_mode/ui_bundled",
    "//ios/chrome/browser/safe_mode/ui_bundled:eg_app_support+eg2",
    "//ios/chrome/browser/search_engines/model:eg_app_support+eg2",
    "//ios/chrome/browser/search_engines/model:search_engines_util",
    "//ios/chrome/browser/search_engines/model:template_url_service_factory",
    "//ios/chrome/browser/sessions/model:session_restoration_service",
    "//ios/chrome/browser/sessions/model:session_restoration_service_factory",
    "//ios/chrome/browser/shared/coordinator/scene:scene_state_header",
    "//ios/chrome/browser/shared/model/application_context",
    "//ios/chrome/browser/shared/model/browser_state",
    "//ios/chrome/browser/shared/model/profile",
    "//ios/chrome/browser/shared/model/web_state_list",
    "//ios/chrome/browser/shared/public/commands",
    "//ios/chrome/browser/shared/public/features",
    "//ios/chrome/browser/shared/ui/symbols",
    "//ios/chrome/browser/shared/ui/table_view/cells",
    "//ios/chrome/browser/shared/ui/util",
    "//ios/chrome/browser/shared/ui/util:eg_app_support+eg2",
    "//ios/chrome/browser/shared/ui/util:omnibox_util",
    "//ios/chrome/browser/ssl/model:eg_app_support+eg2",
    "//ios/chrome/browser/sync/model",
    "//ios/chrome/browser/tabs/ui_bundled/tests:eg_app_support+eg2",
    "//ios/chrome/browser/tips_notifications/model:utils",
    "//ios/chrome/browser/translate/model:eg_app_support+eg2",
    "//ios/chrome/browser/ui/authentication:eg_app_support+eg2",
    "//ios/chrome/browser/ui/authentication/cells",
    "//ios/chrome/browser/ui/browser_container:eg_app_support+eg2",
    "//ios/chrome/browser/ui/content_suggestions:constants",
    "//ios/chrome/browser/ui/content_suggestions:content_suggestions_constant",
    "//ios/chrome/browser/ui/content_suggestions:content_suggestions_ui",
    "//ios/chrome/browser/ui/content_suggestions:eg_app_support+eg2",
    "//ios/chrome/browser/ui/fullscreen/test:eg_app_support+eg2",
    "//ios/chrome/browser/ui/infobars:eg_app_support+eg2",
    "//ios/chrome/browser/ui/omnibox:eg_app_support+eg2",
    "//ios/chrome/browser/ui/omnibox:features",
    "//ios/chrome/browser/ui/omnibox:omnibox_internal",
    "//ios/chrome/browser/ui/omnibox:omnibox_popup_shared",
    "//ios/chrome/browser/ui/omnibox/keyboard_assist",
    "//ios/chrome/browser/ui/omnibox/popup:popup_accessibility_identifier_constants",
    "//ios/chrome/browser/ui/page_info:eg_app_support+eg2",
    "//ios/chrome/browser/ui/partial_translate:eg_app_support+eg2",
    "//ios/chrome/browser/ui/popup_menu:constants",
    "//ios/chrome/browser/ui/popup_menu/overflow_menu:feature_flags",
    "//ios/chrome/browser/ui/reading_list:eg_app_support+eg2",
    "//ios/chrome/browser/ui/recent_tabs:eg_app_support+eg2",
    "//ios/chrome/browser/ui/recent_tabs:recent_tabs_ui_constants",
    "//ios/chrome/browser/ui/settings:constants",
    "//ios/chrome/browser/ui/settings:eg_app_support+eg2",
    "//ios/chrome/browser/ui/settings:settings",
    "//ios/chrome/browser/ui/settings:settings_navigation_controller_constants",
    "//ios/chrome/browser/ui/settings:settings_root",
    "//ios/chrome/browser/ui/settings:settings_root_constants",
    "//ios/chrome/browser/ui/settings/autofill",
    "//ios/chrome/browser/ui/settings/autofill:constants",
    "//ios/chrome/browser/ui/settings/cells",
    "//ios/chrome/browser/ui/settings/clear_browsing_data",
    "//ios/chrome/browser/ui/settings/clear_browsing_data:clear_browsing_data_ui_constants",
    "//ios/chrome/browser/ui/settings/content_settings:eg_app_support+eg2",
    "//ios/chrome/browser/ui/settings/google_services:constants",
    "//ios/chrome/browser/ui/settings/google_services:eg_app_support+eg2",
    "//ios/chrome/browser/ui/settings/google_services/manage_accounts:constants",
    "//ios/chrome/browser/ui/settings/language:eg_app_support+eg2",
    "//ios/chrome/browser/ui/settings/notifications:constants",
    "//ios/chrome/browser/ui/settings/notifications/tracking_price:constants",
    "//ios/chrome/browser/ui/settings/password:eg_app_support+eg2",
    "//ios/chrome/browser/ui/settings/password:password_constants",
    "//ios/chrome/browser/ui/settings/password/password_settings:password_settings_constants",
    "//ios/chrome/browser/ui/settings/password/passwords_in_other_apps:eg_app_support+eg2",
    "//ios/chrome/browser/ui/settings/privacy:privacy_constants",
    "//ios/chrome/browser/ui/settings/privacy:privacy_ui",
    "//ios/chrome/browser/ui/settings/safety_check:safety_check_ui_swift",
    "//ios/chrome/browser/ui/settings/sync",
    "//ios/chrome/browser/ui/settings/tabs:tabs_constants",
    "//ios/chrome/browser/ui/tab_switcher/tab_grid:tab_grid_ui_constants",
    "//ios/chrome/browser/ui/tab_switcher/tab_grid/grid:grid_ui",
    "//ios/chrome/browser/ui/tab_switcher/tab_grid/grid:grid_ui_constants",
    "//ios/chrome/browser/ui/tab_switcher/tab_grid/inactive_tabs:inactive_tabs_constants",
    "//ios/chrome/browser/ui/tab_switcher/tab_grid/tab_groups:eg_app_support+eg2",
    "//ios/chrome/browser/ui/tab_switcher/tab_grid/tab_groups:tab_groups_constant",
    "//ios/chrome/browser/ui/tab_switcher/tab_strip/ui:swift_constants_for_objective_c",
    "//ios/chrome/browser/ui/toolbar:eg_app_support+eg2",
    "//ios/chrome/browser/ui/toolbar:toolbar_ui",
    "//ios/chrome/browser/ui/toolbar/public:constants",
    "//ios/chrome/browser/unified_consent/model",
    "//ios/chrome/browser/unit_conversion/ui_bundled:eg_app_support+eg2",
    "//ios/chrome/browser/variations/model:eg_app_support+eg2",
    "//ios/chrome/browser/web/model",
    "//ios/chrome/browser/web/model:eg_app_support+eg2",
    "//ios/chrome/common/ui/promo_style:constants",
    "//ios/chrome/test/app:test_support",
    "//ios/chrome/test/variations_smoke_test:eg_app_support+eg2",
    "//ios/public/provider/chrome/browser/lens:lens_api",
    "//ios/public/provider/chrome/browser/primes:primes_api",
    "//ios/public/provider/chrome/browser/signin:choice_api",
    "//ios/testing:block_swizzler",
    "//ios/testing:hardware_keyboard_support",
    "//ios/testing:nserror_support",
    "//ios/testing:open_url_context",
    "//ios/testing:verify_custom_webkit",
    "//ios/testing/earl_grey:eg_app_support+eg2",
    "//ios/third_party/earl_grey2:app_framework+link",
    "//ios/third_party/gtx:gtx+link",
    "//ios/third_party/material_components_ios",
    "//ios/web:eg_app_support+eg2",
    "//ios/web/common",
    "//ios/web/js_messaging:js_messaging",
    "//ios/web/js_messaging:web_view_js_utils",
    "//ios/web/public",
    "//ios/web/public/js_messaging",
    "//ios/web/public/test:element_selector",
    "//ios/web/public/test:util",
    "//services/metrics/public/cpp:metrics_cpp",
    "//third_party/metrics_proto",
    "//ui/base",
    "//ui/base:test_support",
  ]
  frameworks = [ "IOKit.framework" ]

  all_dependent_configs = [ "//third_party/protobuf:protobuf_config" ]
}

source_set("eg_test_support+eg2") {
  configs += [ "//build/config/ios:xctest_config" ]
  testonly = true

  sources = [
    "accessibility_util.h",
    "accessibility_util.mm",
    "chrome_actions.h",
    "chrome_actions.mm",
    "chrome_actions_app_interface.h",
    "chrome_actions_app_interface_stub.mm",
    "chrome_earl_grey.h",
    "chrome_earl_grey.mm",
    "chrome_earl_grey_app_interface.h",
    "chrome_earl_grey_app_interface_stub.mm",
    "chrome_earl_grey_ui.h",
    "chrome_earl_grey_ui.mm",
    "chrome_matchers.h",
    "chrome_matchers.mm",
    "chrome_matchers_app_interface.h",
    "chrome_matchers_app_interface_stub.mm",
    "chrome_test_case.h",
    "chrome_test_case.mm",
    "chrome_test_case_app_interface.h",
    "chrome_test_case_app_interface_stub.mm",
    "chrome_xcui_actions.h",
    "chrome_xcui_actions.mm",
    "earl_grey_scoped_block_swizzler.h",
    "earl_grey_scoped_block_swizzler.mm",
    "earl_grey_scoped_block_swizzler_app_interface.h",
    "earl_grey_scoped_block_swizzler_app_interface_stub.mm",
    "scoped_allow_crash_on_startup.h",
    "scoped_allow_crash_on_startup.mm",
    "scoped_block_popups_pref.h",
    "scoped_block_popups_pref.mm",
    "scoped_disable_timer_tracking.h",
    "scoped_disable_timer_tracking.mm",
    "web_http_server_chrome_test_case.h",
    "web_http_server_chrome_test_case.mm",
  ]

  public_deps = [
    ":chrome_egtest_bundle_main+eg2",
    "//components/content_settings/core/common",
  ]

  deps = [
    "//base",
    "//base/test:test_support",
    "//components/strings",
    "//components/sync/base",
    "//ios/chrome/app/strings",
    "//ios/chrome/browser/ntp/ui_bundled:feature_flags",
    "//ios/chrome/browser/policy/model:eg_test_support+eg2",
    "//ios/chrome/browser/safe_mode/ui_bundled:eg_test_support+eg2",
    "//ios/chrome/browser/shared/model/prefs:pref_names",
    "//ios/chrome/browser/shared/ui/table_view:constants",
    "//ios/chrome/browser/ui/browser_container:eg_test_support+eg2",
    "//ios/chrome/browser/ui/partial_translate:eg_test_support+eg2",
    "//ios/chrome/browser/ui/popup_menu:constants",
    "//ios/chrome/browser/ui/recent_tabs:recent_tabs_ui_constants",
    "//ios/chrome/browser/ui/settings/password:eg_test_support+eg2",
    "//ios/chrome/browser/ui/tab_switcher/tab_grid:tab_grid_ui_constants",
    "//ios/chrome/browser/ui/tab_switcher/tab_grid/grid:grid_ui_constants",
    "//ios/chrome/browser/ui/toolbar:eg_test_support+eg2",
    "//ios/chrome/browser/web/model:feature_flags",
    "//ios/chrome/test:eg_test_support+eg2",
    "//ios/testing:http_server_bundle_data",
    "//ios/testing:nserror_support",
    "//ios/testing/earl_grey:eg_test_support+eg2",
    "//ios/testing/earl_grey:launch_configuration",
    "//ios/third_party/edo",
    "//ios/third_party/gtx:gtx+link",
    "//ios/web/common:features",
    "//ios/web/public/test:element_selector",
    "//ios/web/public/test/http_server",
    "//net:test_support",
    "//third_party/metrics_proto",
    "//ui/base",
    "//url",
  ]

  all_dependent_configs = [ "//third_party/protobuf:protobuf_config" ]
}

source_set("chrome_egtest_bundle_main+eg2") {
  configs += [
    "//build/config/ios:xctest_config",

    # Adding this config to exempt from the style check:
    # "cannot use 'try' with exceptions disabled". This cannot be fixed because
    # it's part of the gRPC library.
    "//build/config/compiler:exceptions",
  ]
  testonly = true

  sources = [
    "chrome_egtest_bundle_main.h",
    "chrome_egtest_bundle_main.mm",
  ]

  deps = [
    ":chrome_egtest_plugin_client",
    "//base",
    "//base:i18n",
    "//third_party/grpc:grpc++",
    "//ui/base",
  ]
}

source_set("chrome_egtest_plugin_client") {
  configs += [
    # Adding this config to exempt from the style check:
    # "cannot use 'try' with exceptions disabled". This cannot be fixed because
    # it's part of the gRPC library.
    "//build/config/compiler:exceptions",
  ]
  testonly = true

  sources = [
    "chrome_egtest_plugin_client.h",
    "chrome_egtest_plugin_client.mm",
  ]

  deps = [
    "//base",
    "//ios/testing/plugin:test_plugin_service",
    "//third_party/grpc:grpc++",
  ]
}

source_set("switches") {
  testonly = true
  sources = [
    "test_switches.h",
    "test_switches.mm",
  ]
}