| # Copyright 2021 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/apple/tweak_info_plist.gni") |
| import("//build/config/ios/rules.gni") |
| import("//ios/build/chrome_build.gni") |
| import("//ios/public/provider/chrome/browser/build_config.gni") |
| |
| # Template to build a simple Chrome host app for XCUITests. |
| # |
| # Arguments |
| # |
| # use_default_test_hooks: |
| # (optional) boolean, whether to use the default test hooks. If false or |
| # not set, must include a custom implementation in deps. |
| template("ios_chrome_xcuitest_app_host") { |
| _tweak_info_plist = target_name + "_tweak_info_plist" |
| tweak_info_plist(_tweak_info_plist) { |
| info_plists = [ |
| "//ios/chrome/app/resources/Info.plist", |
| "//ios/chrome/app/resources/ChromeAddition+Info.plist", |
| ] |
| } |
| |
| ios_app_bundle(target_name) { |
| testonly = true |
| forward_variables_from(invoker, "*", TESTONLY_AND_VISIBILITY) |
| |
| if (!defined(deps)) { |
| deps = [] |
| } |
| deps += [ "//ios/chrome/app:main" ] |
| if (defined(use_default_test_hooks) && use_default_test_hooks) { |
| deps += [ "//ios/chrome/test/xcuitest:hooks" ] |
| } |
| |
| if (!defined(bundle_deps)) { |
| bundle_deps = [] |
| } |
| bundle_deps += [ |
| "//ios/chrome/app/resources", |
| ios_application_icons_target, |
| ] |
| bundle_deps += ios_providers_resources_targets |
| |
| info_plist_target = ":$_tweak_info_plist" |
| extra_substitutions = [ |
| "CHROMIUM_HANDOFF_ID=$chromium_handoff_id", |
| "CHROMIUM_SHORT_NAME=$target_name", |
| "CHROMIUM_URL_CHANNEL_SCHEME=$url_channel_scheme", |
| "CHROMIUM_URL_SCHEME_1=$url_unsecure_scheme", |
| "CHROMIUM_URL_SCHEME_2=$url_secure_scheme", |
| "CHROMIUM_URL_SCHEME_3=$url_x_callback_scheme", |
| "CHROMIUM_BUNDLE_ID=gtest.$target_name", |
| "CONTENT_WIDGET_EXTENSION_BUNDLE_ID=$chromium_bundle_id.ContentTodayExtension", |
| "IOS_MOVE_TAB_ACTIVITY_TYPE=$ios_move_tab_activity_type", |
| "SSOAUTH_URL_SCHEME=$url_ssoauth_scheme", |
| ] |
| } |
| } |
| |
| set_defaults("ios_chrome_xcuitest_app_host") { |
| configs = default_executable_configs |
| } |