blob: e9869b91ab57127cc3cf02de5bfa5c09894d6e85 [file] [log] [blame]
# Copyright 2019 The Chromium Authors
# 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/python.gni")
import("//build/config/sanitizers/sanitizers.gni")
import("//build/util/process_version.gni")
import("//chrome/enterprise_companion/branding.gni")
import("//chrome/updater/apply_updater_branding.gni")
import("//chrome/updater/branding.gni")
import("//components/crx_file/crx3.gni")
import("//testing/test.gni")
if (is_win) {
import("//third_party/icu/config.gni")
}
# Run 'gn check out\Default --check-generated //chrome/updater/*' every time
# dependencies are modified until a presubmit is written to automatically
# check that the C++ includes match the build dependency graph.
group("updater") {
if (is_win) {
deps = [ "//chrome/updater/win" ]
}
if (is_mac) {
deps = [ "//chrome/updater/mac" ]
}
if (is_linux) {
deps = [ "//chrome/updater/linux" ]
}
if (is_win || is_mac || is_linux) {
deps += [
":updater_license",
"//chrome/updater/test/qualification_app",
"//chrome/updater/tools",
]
}
# These packages have problematic license files that we need to avoid for
# updater redistribution.
if (!is_component_build) {
assert_no_deps = [ "//third_party/libaom" ]
}
}
group("all") {
testonly = true
if (is_win || is_mac || is_linux) {
deps = [
":updater",
":updater_tests",
":updater_tests_system",
]
if (is_win) {
deps += [ "win/installer:msi_custom_action" ]
}
}
}
if (is_win || is_mac || is_linux) {
action("updater_license") {
script = "//chrome/updater/fix_licenses.py"
deps = [ ":generate_updater_license" ]
_trimmed_license_path =
"$root_out_dir/LICENSE.$updater_product_full_name_dashed_lowercase"
_orig_license_path = "$target_gen_dir/UNTRIMMED_LICENSE.$updater_product_full_name_dashed_lowercase"
args = [
"--src",
rebase_path(_orig_license_path, root_build_dir),
"--dest",
rebase_path(_trimmed_license_path, root_build_dir),
]
outputs = [ _trimmed_license_path ]
}
action("generate_updater_license") {
script = "//tools/licenses/licenses.py"
_license_path = "$target_gen_dir/UNTRIMMED_LICENSE.$updater_product_full_name_dashed_lowercase"
depfile = "$target_gen_dir/$target_name.d"
args = [
"license_file",
rebase_path(_license_path, root_build_dir),
"--depfile",
rebase_path(depfile, root_build_dir),
"--gn-target",
"//chrome/updater:updater",
"--gn-out-dir",
".",
"--target-os",
target_os,
]
outputs = [ _license_path ]
}
source_set("base") {
sources = [
"action_handler.h",
"activity.cc",
"activity.h",
"activity_impl.h",
"app/app_install.cc",
"app/app_install.h",
"app/app_install_progress.cc",
"app/app_install_progress.h",
"app/app_recover.cc",
"app/app_recover.h",
"app/app_server.cc",
"app/app_server.h",
"app/app_uninstall.cc",
"app/app_uninstall.h",
"app/app_uninstall_self.cc",
"app/app_uninstall_self.h",
"app/app_update.cc",
"app/app_update.h",
"app/app_utils.cc",
"app/app_utils.h",
"app/app_wake.cc",
"app/app_wake.h",
"app/app_wakeall.cc",
"app/app_wakeall.h",
"auto_run_on_os_upgrade_task.cc",
"auto_run_on_os_upgrade_task.h",
"change_owners_task.h",
"check_for_updates_task.cc",
"check_for_updates_task.h",
"cleanup_task.cc",
"cleanup_task.h",
"configurator.cc",
"configurator.h",
"crash_client.cc",
"crash_client.h",
"crash_reporter.cc",
"crash_reporter.h",
"crx_downloader_factory.h",
"event_logger.cc",
"event_logger.h",
"handle_inconsistent_apps_task.cc",
"handle_inconsistent_apps_task.h",
"installer.cc",
"installer.h",
"ipc/update_service_internal_proxy.cc",
"ipc/update_service_internal_proxy.h",
"lock.cc",
"lock.h",
"net/fallback_net_fetcher.cc",
"net/fallback_net_fetcher.h",
"net/network.h",
"persisted_data.cc",
"persisted_data.h",
"ping_configurator.cc",
"ping_configurator.h",
"ping_persisted_data.cc",
"ping_persisted_data.h",
"policy/dm_policy_manager.cc",
"policy/dm_policy_manager.h",
"policy/manager.cc",
"policy/manager.h",
"policy/platform_policy_manager.cc",
"policy/platform_policy_manager.h",
"policy/policy_fetcher.cc",
"policy/policy_fetcher.h",
"policy/policy_manager.cc",
"policy/policy_manager.h",
"policy/service.cc",
"policy/service.h",
"prefs.cc",
"prefs.h",
"prefs_impl.h",
"remove_uninstalled_apps_task.cc",
"remove_uninstalled_apps_task.h",
"setup.h",
"update_block_check.cc",
"update_block_check.h",
"update_service_impl.cc",
"update_service_impl.h",
"update_service_impl_impl.cc",
"update_service_impl_impl.h",
"update_service_impl_inactive.cc",
"update_service_impl_inactive.h",
"update_service_internal.h",
"update_service_internal_impl.cc",
"update_service_internal_impl.h",
"update_service_internal_impl_inactive.cc",
"update_service_internal_impl_inactive.h",
"update_service_internal_impl_qualifying.cc",
"update_service_internal_impl_qualifying.h",
"updater.cc",
"updater.h",
"usage_stats_permissions.h",
]
deps = [
":branding_header",
":constants_header",
":tagging",
":version_header",
"//base",
"//base:i18n",
"//build:chromeos_buildflags",
"//chrome/enterprise_companion:client",
"//chrome/enterprise_companion:constants_prod",
"//chrome/enterprise_companion:installer_paths",
"//chrome/enterprise_companion/device_management_storage",
"//chrome/enterprise_companion/mojom",
"//chrome/enterprise_companion/telemetry_logger",
"//chrome/enterprise_companion/telemetry_logger/proto",
"//chrome/updater/protos:omaha_proto",
"//components/crash/core/common",
"//components/crx_file",
"//components/named_system_lock",
"//components/policy/core/common:common_constants",
"//components/policy/proto",
"//components/prefs",
"//components/update_client",
"//components/update_client:in_process_patcher",
"//components/update_client:in_process_unzipper",
"//components/version_info",
"//crypto",
"//third_party/abseil-cpp:absl",
"//third_party/boringssl",
"//third_party/crashpad/crashpad/client",
"//third_party/crashpad/crashpad/handler",
"//url",
]
if (is_component_build) {
deps += [ "//components/policy/core/common" ]
} else {
deps += [
"//components/policy/core/common:common_constants",
"//components/policy/core/common:util",
]
}
public_deps = [
":base_app",
":external_constants",
]
defines = []
if (is_mac) {
sources += [
"activity_impl_util_mac.cc",
"app/app_net_worker.cc",
"app/app_net_worker.h",
"app/app_server_posix_mac.cc",
"cleanup_task_mac.mm",
"installer_mac.cc",
"ipc/ipc_security_mac.cc",
"mac/install_from_archive.h",
"mac/install_from_archive.mm",
"mac/setup/mac_setup.mm",
"mac/setup/wake_task.h",
"mac/setup/wake_task.mm",
"net/fetcher_callback_adapter.cc",
"net/fetcher_callback_adapter.h",
"net/network_fetcher_mac.mm",
"net/network_file_fetcher.h",
"policy/mac/managed_preference_policy_manager.mm",
"policy/mac/managed_preference_policy_manager_impl.h",
"policy/mac/managed_preference_policy_manager_impl.mm",
"setup_mac.mm",
"update_service_internal_impl_qualifying_mac.cc",
"usage_stats_permissions_mac.mm",
]
deps += [
":ks_ticket",
"//chrome/updater/net/mac/mojom",
"//mojo/public/cpp/platform",
"//net",
]
frameworks = [
"AppKit.framework",
"CoreServices.framework",
"Foundation.framework",
"ServiceManagement.framework",
"SystemConfiguration.framework",
]
}
if (is_win) {
sources += [
"activity_impl_win.cc",
"app/app_install_util_win.cc",
"app/app_install_util_win.h",
"app/app_install_win.cc",
"app/app_install_win_internal.h",
"app/app_server_win.cc",
"app/app_server_win.h",
"app/server/win/com_classes.cc",
"app/server/win/com_classes.h",
"app/server/win/com_classes_legacy.cc",
"app/server/win/com_classes_legacy.h",
"app/server/win/com_classes_util.cc",
"app/server/win/com_classes_util.h",
"app/server/win/update_service_internal_stub_win.cc",
"app/server/win/update_service_internal_stub_win.h",
"app/server/win/update_service_stub_win.cc",
"app/server/win/update_service_stub_win.h",
"app/server/win/updater_service_delegate.cc",
"app/server/win/updater_service_delegate.h",
"app/server/win/wrl_classes.cc",
"change_owners_task_win.cc",
"ipc/update_service_internal_proxy_win.cc",
"ipc/update_service_internal_proxy_win.h",
"net/network_fetcher_win.cc",
"policy/win/group_policy_manager.cc",
"policy/win/group_policy_manager.h",
"remove_uninstalled_apps_task_win.cc",
"setup_win.cc",
"update_block_check_win.cc",
"update_service_internal_impl_qualifying_win.cc",
"usage_stats_permissions_win.cc",
"util/progress_sampler.cc",
"util/progress_sampler.h",
"win/action_handler.cc",
"win/app_command_runner.cc",
"win/app_command_runner.h",
"win/installer/exit_code.h",
"win/installer_api.cc",
"win/installer_api.h",
"win/manifest_util.cc",
"win/manifest_util.h",
"win/protocol_parser_xml.cc",
"win/protocol_parser_xml.h",
"win/scoped_impersonation.cc",
"win/scoped_impersonation.h",
"win/setup/setup_util.cc",
"win/setup/setup_util.h",
"win/setup/uninstall.cc",
"win/setup/uninstall.h",
"win/setup/win_setup.cc",
"win/setup/win_setup.h",
"win/ui/complete_wnd.cc",
"win/ui/complete_wnd.h",
"win/ui/l10n_util.cc",
"win/ui/l10n_util.h",
"win/ui/owner_draw_controls.cc",
"win/ui/owner_draw_controls.h",
"win/ui/progress_wnd.cc",
"win/ui/progress_wnd.h",
"win/ui/ui.cc",
"win/ui/ui.h",
"win/ui/ui_constants.h",
"win/ui/ui_ctls.h",
"win/ui/ui_util.cc",
"win/ui/ui_util.h",
]
deps += [
"//build:branding_buildflags",
"//chrome/installer/util:constants",
"//chrome/installer/util:metainstaller_utils",
"//chrome/installer/util:work_item",
"//chrome/updater/app/server/win:updater_idl",
"//chrome/updater/app/server/win:updater_idl_system",
"//chrome/updater/app/server/win:updater_idl_user",
"//chrome/updater/app/server/win:updater_internal_idl",
"//chrome/updater/app/server/win:updater_internal_idl_system",
"//chrome/updater/app/server/win:updater_internal_idl_user",
"//chrome/updater/app/server/win:updater_legacy_idl",
"//chrome/updater/app/server/win:updater_legacy_idl_system",
"//chrome/updater/app/server/win:updater_legacy_idl_user",
"//chrome/updater/win/ui/resources",
"//chrome/updater/win/ui/resources:strings",
"//chrome/windows_services/service_program:delegate",
"//chrome/windows_services/service_program:lib",
"//components/winhttp",
"//third_party/wtl",
]
configs -= [ "//build/config/win:winver" ]
configs += [
"//chrome/updater/app/server/win:winver",
"//chrome/updater/win:wrl_strict",
]
libs = [
"msxml2.lib",
"wtsapi32.lib",
]
}
if (is_posix) {
sources += [
"activity_impl_posix.cc",
"activity_impl_util_posix.h",
"app/app_server_posix.cc",
"app/app_server_posix.h",
"app/server/posix/update_service_internal_stub.cc",
"app/server/posix/update_service_internal_stub.h",
"app/server/posix/update_service_stub.cc",
"app/server/posix/update_service_stub.h",
"change_owners_task_posix.cc",
"ipc/ipc_security.h",
"ipc/update_service_internal_proxy_posix.cc",
"ipc/update_service_internal_proxy_posix.h",
"remove_uninstalled_apps_task_posix.cc",
]
deps += [
"//chrome/updater/mojom",
"//components/named_mojo_ipc_server",
]
}
if (is_linux) {
sources += [
"activity_impl_util_linux.cc",
"app/app_server_posix_linux.cc",
"installer_linux.cc",
"ipc/ipc_security_linux.cc",
"linux/setup/linux_setup.cc",
"linux/systemd_util.cc",
"linux/systemd_util.h",
"net/network_fetcher_linux.cc",
"setup_linux.cc",
"update_service_internal_impl_qualifying_linux.cc",
"usage_stats_permissions_linux.cc",
]
libs = [
"curl",
"systemd",
]
}
}
if (is_mac) {
source_set("ks_ticket") {
sources = [
"mac/setup/ks_tickets.h",
"mac/setup/ks_tickets.mm",
]
deps = [ "//base" ]
}
}
# Set of sources that are required to create an executable based on `App`.
source_set("base_app") {
sources = [
"app/app.cc",
"app/app.h",
]
deps = [ ":constants_header" ]
public_deps = [
":public_sources",
"//base",
]
}
source_set("constants_header") {
sources = [ "constants.h" ]
public_deps = [ "//base" ]
deps = [ "//components/update_client" ]
}
source_set("external_constants") {
sources = [
"external_constants.cc",
"external_constants.h",
"external_constants_default.cc",
"external_constants_default.h",
]
deps = [
":branding_header",
":constants_header",
"//base",
"//build:branding_buildflags",
"//components/crx_file",
"//url",
]
}
source_set("constants_prod") {
sources = [
"constants_prod.cc",
"external_constants_prod.cc",
]
deps = [
":constants_header",
":external_constants",
"//base",
]
}
source_set("constants_test") {
sources = [
"constants_test.cc",
"external_constants_override.cc",
"external_constants_override.h",
]
deps = [
":branding_header",
":constants_header",
":external_constants",
":public_sources",
":version_header",
"//base",
"//components/crx_file",
"//url",
]
}
process_version("version_header") {
sources = [ "//chrome/VERSION" ]
template_file = "updater_version.h.in"
output = "$target_gen_dir/updater_version.h"
}
apply_updater_branding("branding_header") {
template_file = "updater_branding.h.in"
output = "$target_gen_dir/updater_branding.h"
}
source_set("browser_sources") {
sources = [
# Ideally we would have :constants_prod as a public_dep. However, this
# pulls in a static initializer, which is not allowed in Chromium.
"constants_prod.cc",
]
public_deps = [
":public_sources",
":tagging",
]
deps = [ ":constants_header" ]
visibility = [
"//chrome/browser",
"//chrome/browser/ui",
"//chrome/browser/updater:*",
"//chrome/enterprise_companion:*",
"//chrome/enterprise_companion/device_management_storage:*",
"//chrome/test:*",
"//chrome/test:unit_tests",
]
}
source_set("tagging") {
sources = [
"certificate_tag.cc",
"certificate_tag.h",
"certificate_tag_internal.h",
"tag.cc",
"tag.h",
]
deps = [ "//base" ]
}
source_set("public_sources") {
sources = [
"branded_constants.h",
"constants.h",
"enum_traits.h",
"ipc/ipc_support.cc",
"ipc/ipc_support.h",
"ipc/update_service_proxy.cc",
"ipc/update_service_proxy.h",
"registration_data.cc",
"registration_data.h",
"service_proxy_factory.h",
"update_service.cc",
"update_service.h",
"updater_scope.cc",
"updater_scope.h",
"util/util.cc",
"util/util.h",
]
deps = [
":branding_header",
":tagging",
":version_header",
"//base",
"//chrome/enterprise_companion:installer_paths",
"//components/policy/core/common:common_constants",
"//components/update_client",
"//mojo/core/embedder",
"//url",
]
if (is_win) {
sources += [
"ipc/proxy_impl_base_win.h",
"ipc/update_service_proxy_win.cc",
"ipc/update_service_proxy_win.h",
"util/win_util.cc",
"util/win_util.h",
"win/scoped_handle.h",
"win/task_scheduler.cc",
"win/task_scheduler.h",
"win/user_info.cc",
"win/user_info.h",
"win/win_constants.h",
]
deps += [
"//chrome/updater/app/server/win:updater_idl",
"//chrome/windows_services/service_program:common",
]
configs -= [ "//build/config/win:winver" ]
configs += [
"//chrome/updater/app/server/win:winver",
"//chrome/updater/win:wrl_strict",
]
defines = [ "SECURITY_WIN32" ]
libs = [
"secur32.lib",
"taskschd.lib",
"wtsapi32.lib",
]
}
if (is_linux) {
sources += [
"ipc/ipc_names_linux.cc",
"ipc/update_service_dialer_linux.cc",
"linux/ipc_constants.cc",
"linux/ipc_constants.h",
"util/linux_util.cc",
"util/linux_util.h",
]
}
if (is_mac) {
sources += [
"ipc/ipc_names_mac.mm",
"ipc/update_service_dialer_mac.cc",
"mac/privileged_helper/service_protocol.h",
"mac/setup/keystone.h",
"mac/setup/keystone.mm",
"util/mac_util.h",
"util/mac_util.mm",
]
deps += [ ":ks_ticket" ]
frameworks = [ "Foundation.framework" ]
}
if (is_posix) {
sources += [
"ipc/ipc_names.h",
"ipc/update_service_dialer.h",
"ipc/update_service_proxy_posix.cc",
"ipc/update_service_proxy_posix.h",
"posix/setup.h",
"util/posix_util.cc",
"util/posix_util.h",
]
deps += [
"//chrome/updater/mojom",
"//components/named_mojo_ipc_server",
]
}
}
if (is_linux || is_mac || is_win) {
crx3("updater_selfupdate_test_crx") {
base_dir = "$root_build_dir"
key = "test/data/selfupdate_test_key.der"
output = "$root_build_dir/updater_selfupdate.crx3"
testonly = true
if (is_linux) {
inputs = [ "$root_build_dir/updater_test" ]
deps = [ "//chrome/updater/linux:updater_test" ]
}
if (is_mac) {
inputs = [
"$root_build_dir/.install",
"$root_build_dir/${updater_product_full_name}_test.app/Contents/Info.plist",
"$root_build_dir/${updater_product_full_name}_test.app/Contents/MacOS/${updater_product_full_name}_test",
"$root_build_dir/${updater_product_full_name}_test.app/Contents/Helpers/$keystone_app_name.bundle/Contents/MacOS/$keystone_app_name",
"$root_build_dir/${updater_product_full_name}_test.app/Contents/Helpers/$keystone_app_name.bundle/Contents/Helpers/ksinstall",
"$root_build_dir/${updater_product_full_name}_test.app/Contents/Helpers/$keystone_app_name.bundle/Contents/Helpers/ksadmin",
"$root_build_dir/${updater_product_full_name}_test.app/Contents/Helpers/$keystone_app_name.bundle/Contents/Resources/${keystone_app_name}Agent.app/Contents/MacOS/${keystone_app_name}Agent",
"$root_build_dir/${updater_product_full_name}_test.app/Contents/Helpers/$keystone_app_name.bundle/Contents/Resources/${keystone_app_name}Agent.app/Contents/Info.plist",
"$root_build_dir/${updater_product_full_name}_test.app/Contents/Helpers/$keystone_app_name.bundle/Contents/Info.plist",
"$root_build_dir/${updater_product_full_name}_test.app/Contents/Helpers/launcher",
"$root_build_dir/${updater_product_full_name}_test.app/Contents/PkgInfo",
]
deps = [
"//chrome/updater/mac:updater_bundle_test",
"//chrome/updater/mac:updater_test_install_script",
]
# Mac ASAN builds have an extra dylib that must be packaged in the CRX.
if (is_asan) {
inputs += [
"$root_build_dir/${updater_product_full_name}_test.app/Contents/Helpers/$keystone_app_name.bundle/Contents/MacOS/libclang_rt.asan_osx_dynamic.dylib",
"$root_build_dir/${updater_product_full_name}_test.app/Contents/MacOS/libclang_rt.asan_osx_dynamic.dylib",
]
}
}
if (is_win) {
inputs = [ "$root_build_dir/UpdaterSetup_test.exe" ]
deps = [ "//chrome/updater/win/installer:installer_test" ]
if (is_asan) {
# TODO(crbug.com/367746304): Get the inputs from //build/win:runtime.
deps += [ "//build/config/sanitizers:copy_sanitizer_runtime" ]
inputs += [ "$root_build_dir/clang_rt.asan_dynamic-x86_64.dll" ]
}
if (is_component_build) {
inputs += [
"$root_build_dir/base.dll",
"$root_build_dir/ui_base.dll",
]
if (is_debug) {
data = [ "$root_build_dir/ucrtbased.dll" ]
}
deps += [ "//ui/base" ]
}
}
}
if (is_mac) {
process_version("enterprise_companion_test_crx_install_script") {
extra_args = [
"-e",
"PRODUCT_NAME=\"${enterprise_companion_product_full_name}\"",
]
process_only = true
executable = true
template_file = "test/data/enterprise_companion_install_script.sh.in"
output =
"$target_gen_dir/enterprise_companion_test_crx_contents/.install"
}
_enterprise_companion_app_name =
"${enterprise_companion_product_full_name}.app"
_source_bundle_path = "$root_build_dir/EnterpriseCompanionTestApp/${_enterprise_companion_app_name}"
copy("enterprise_companion_test_crx_exe") {
sources = [ "${_source_bundle_path}/Contents/MacOS/${enterprise_companion_product_full_name}" ]
outputs = [ "$target_gen_dir/enterprise_companion_test_crx_contents/${_enterprise_companion_app_name}/Contents/MacOS/{{source_file_part}}" ]
deps = [
"//chrome/enterprise_companion/mac:enterprise_companion_bundle_test",
]
}
copy("enterprise_companion_test_crx_pkginfo") {
sources = [ "${_source_bundle_path}/Contents/PkgInfo" ]
outputs = [ "$target_gen_dir/enterprise_companion_test_crx_contents/${_enterprise_companion_app_name}/Contents/{{source_file_part}}" ]
deps = [
"//chrome/enterprise_companion/mac:enterprise_companion_bundle_test",
]
}
copy("enterprise_companion_test_crx_plist") {
sources = [ "${_source_bundle_path}/Contents/Info.plist" ]
outputs = [ "$target_gen_dir/enterprise_companion_test_crx_contents/${_enterprise_companion_app_name}/Contents/{{source_file_part}}" ]
deps = [
"//chrome/enterprise_companion/mac:enterprise_companion_bundle_test",
]
}
if (is_asan) {
copy("enterprise_companion_test_crx_asan_dylib") {
sources = [ "${_source_bundle_path}/Contents/MacOS/libclang_rt.asan_osx_dynamic.dylib" ]
outputs = [ "$target_gen_dir/enterprise_companion_test_crx_contents/${_enterprise_companion_app_name}/Contents/MacOS/{{source_file_part}}" ]
deps = [ "//chrome/enterprise_companion/mac:enterprise_companion_bundle_test" ]
}
}
}
crx3("enterprise_companion_test_crx") {
testonly = true
if (is_linux) {
inputs = [ "$root_build_dir/enterprise_companion_test" ]
deps = [ "//chrome/enterprise_companion:enterprise_companion_test" ]
} else if (is_mac) {
inputs = get_target_outputs(
":enterprise_companion_test_crx_install_script") +
get_target_outputs(":enterprise_companion_test_crx_exe") +
get_target_outputs(":enterprise_companion_test_crx_pkginfo") +
get_target_outputs(":enterprise_companion_test_crx_plist")
deps = [
":enterprise_companion_test_crx_exe",
":enterprise_companion_test_crx_install_script",
":enterprise_companion_test_crx_pkginfo",
":enterprise_companion_test_crx_plist",
]
base_dir = "$target_gen_dir/enterprise_companion_test_crx_contents/"
if (is_asan) {
inputs +=
get_target_outputs(":enterprise_companion_test_crx_asan_dylib")
deps += [ ":enterprise_companion_test_crx_asan_dylib" ]
}
} else if (is_win) {
inputs = [ "$root_build_dir/enterprise_companion_test.exe" ]
if (icu_use_data_file) {
inputs += [ "$root_out_dir/icudtl.dat" ]
}
deps = [ "//chrome/enterprise_companion:enterprise_companion_test" ]
}
key = "//chrome/updater/test/data/selfupdate_test_key.der"
output = "$root_build_dir/enterprise_companion_test.crx3"
}
}
source_set("unit_test_util_sources") {
testonly = true
sources = [
"test/test_scope.h",
"test/unit_test_util.cc",
"test/unit_test_util.h",
]
if (is_win) {
sources += [
"//chrome/test/base/process_inspector_win.cc",
"//chrome/test/base/process_inspector_win.h",
]
}
deps = [
":base",
":public_sources",
":tagging",
"//base",
"//base/test:test_support",
"//testing/gtest",
"//third_party/abseil-cpp:absl",
]
if (is_win) {
deps += [ "//chrome/updater/win/test:test_executables" ]
}
}
source_set("updater_test_sources") {
testonly = true
sources = [
"app/app_server_unittest.cc",
"app/app_uninstall_unittest.cc",
"app/app_utils_unittest.cc",
"branded_constants_unittest.cc",
"certificate_tag_unittest.cc",
"cleanup_task_unittest.cc",
"enum_traits_unittest.cc",
"event_logger_unittest.cc",
"external_constants_builder.cc",
"external_constants_builder.h",
"external_constants_builder_unittest.cc",
"external_constants_override_unittest.cc",
"installer_unittest.cc",
"net/fallback_net_fetcher_unittest.cc",
"net/network_unittest.cc",
"persisted_data_unittest.cc",
"policy/dm_policy_manager_unittest.cc",
"policy/manager_unittest.cc",
"policy/policy_manager_unittest.cc",
"policy/service_unittest.cc",
"prefs_unittest.cc",
"tag_unittest.cc",
"test/dm_policy_builder.cc",
"test/dm_policy_builder.h",
"test/http_request.cc",
"test/http_request.h",
"test/integration_test_commands.h",
"test/integration_test_commands_system.cc",
"test/integration_test_commands_user.cc",
"test/integration_tests_impl.cc",
"test/integration_tests_impl.h",
"test/request_matcher.cc",
"test/request_matcher.h",
"test/server.cc",
"test/server.h",
"test/unit_test_util_unittest.cc",
"update_service_impl_impl_unittest.cc",
"update_service_impl_inactive_unittest.cc",
"update_service_unittest.cc",
"updater_scope_unittest.cc",
"updater_unittest.cc",
"usage_stats_permissions_unittest.cc",
"util/util_unittest.cc",
]
if (!is_component_build) {
sources += [ "test/integration_tests.cc" ]
}
deps = [
":base",
":branding_header",
":constants_test",
":public_sources",
":tagging",
":unit_test_util_sources",
":version_header",
"//base",
"//base/test:test_support",
"//chrome/common:constants",
"//chrome/enterprise_companion:constants_test",
"//chrome/enterprise_companion:installer_paths",
"//chrome/enterprise_companion:version_header",
"//chrome/enterprise_companion/device_management_storage",
"//chrome/updater/protos:omaha_proto",
"//components/crx_file",
"//components/policy/core/common:common_constants",
"//components/policy/proto",
"//components/prefs:test_support",
"//components/update_client",
"//net:test_support",
"//testing/gmock",
"//testing/gtest",
"//third_party/abseil-cpp:absl",
"//third_party/crashpad/crashpad/client",
"//third_party/re2",
"//third_party/zlib/google:compression_utils",
"//url",
]
data = [
"test/data/app_logos/googletest.bmp",
"test/data/signed.exe", # Payload used by network tests.
"test/data/signed.exe.gz",
"test/data/tagged_encode_utf8.exe",
"test/data/tagged_msi/GUH-ampersand-ending.msi",
"test/data/tagged_msi/GUH-bad-format.msi",
"test/data/tagged_msi/GUH-bad-format2.msi",
"test/data/tagged_msi/GUH-brand-only.msi",
"test/data/tagged_msi/GUH-empty-key.msi",
"test/data/tagged_msi/GUH-empty-tag.msi",
"test/data/tagged_msi/GUH-empty-value.msi",
"test/data/tagged_msi/GUH-invalid-key.msi",
"test/data/tagged_msi/GUH-invalid-length.msi",
"test/data/tagged_msi/GUH-invalid-marker.msi",
"test/data/tagged_msi/GUH-multiple.msi",
"test/data/tagged_msi/GUH-size-greater-than-max.msi",
"test/data/tagged_msi/GUH-special-value.msi",
"test/data/tagged_msi/GUH-untagged.msi",
]
data_deps = [
":enterprise_companion_test_crx",
":updater_selfupdate_test_crx",
"//chrome/updater/test/test_installer:app_installers",
]
defines = []
if (is_win) {
sources += [
"activity_impl_win_unittest.cc",
"app/app_install_win_unittest.cc",
"app/server/win/com_classes_legacy_unittest.cc",
"app/server/win/com_classes_util_unittest.cc",
"auto_run_on_os_upgrade_task_unittest.cc",
"policy/win/group_policy_manager_unittest.cc",
"test/integration_tests_win.cc",
"test/integration_tests_win.h",
"test/unit_test_util_win.cc",
"test/unit_test_util_win.h",
"updater_process_version_rc_template_unittest.cc",
"util/progress_sampler_unittest.cc",
"util/util_win_unittest.cc",
"util/win_util_unittest.cc",
"win/app_command_runner_unittest.cc",
"win/installer/configuration_unittest.cc",
"win/installer/installer_win_unittest.cc",
"win/installer/msi_custom_action_unittest.cc",
"win/installer/string_unittest.cc",
"win/installer_api_unittest.cc",
"win/manifest_util_unittest.cc",
"win/protocol_parser_xml_unittest.cc",
"win/setup/setup_util_unittest.cc",
"win/task_scheduler_unittest.cc",
"win/ui/l10n_util_unittest.cc",
"win/ui/progress_wnd_unittest.cc",
"win/updater_tests.rc",
]
deps += [
"app/server/win:updater_idl",
"app/server/win:updater_internal_idl",
"app/server/win:updater_legacy_idl",
"test/qualification_app:qualification_app",
"win:updater_test",
"win/installer:installer",
"win/installer:installer_test",
"win/installer:lib",
"win/installer:msi_custom_action",
"win/installer:msi_custom_action_sources",
"win/test:test_executables",
"win/test:test_strings",
"win/ui/resources",
"//third_party/wtl",
]
data_deps += [
"//chrome/enterprise_companion:enterprise_companion_test",
"//chrome/updater/win:updater",
"//chrome/updater/win:updater_test",
"//chrome/updater/win/installer:installer_test",
"//chrome/updater/win/test:updater_test_process",
]
data += [
"test/data/ProcmonConfiguration.pmc",
"//chrome/test/data/updater/OfflineManifest.gup",
"//chrome/test/data/updater/updater_qualification_app_exe.crx",
]
if (target_cpu == "arm64") {
data += [
"//third_party/updater/chrome_win_arm64/cipd/UpdaterSetup_test.exe",
"//third_party/updater/chromium_win_arm64/cipd/UpdaterSetup_test.exe",
]
}
if (target_cpu == "x64") {
data += [
"//third_party/updater/chrome_win_x86_64/cipd/UpdaterSetup_test.exe",
"//third_party/updater/chromium_win_x86_64/cipd/UpdaterSetup_test.exe",
]
}
if (target_cpu == "x86") {
data += [
"//third_party/updater/chrome_win_x86/cipd/UpdaterSetup_test.exe",
"//third_party/updater/chromium_win_x86/cipd/UpdaterSetup_test.exe",
]
}
if (is_chrome_branded) {
sources +=
[ "enterprise/win/google/build_group_policy_template_unittest.cc" ]
data += [
"enterprise/win/google/build_group_policy_template_unittest.py",
"enterprise/win/google/generate_group_policy_template_adm.py",
"enterprise/win/google/generate_group_policy_template_admx.py",
"test/data/enterprise/win/google/test_gold.adm",
"test/data/enterprise/win/google/test_gold.admx",
"test/data/enterprise/win/google/test_gold.adml",
]
}
defines += [ "SECURITY_WIN32" ]
libs = [
"secur32.lib",
"taskschd.lib",
"urlmon.lib",
]
}
if (is_mac) {
sources += [
"app/app_net_worker_unittest.cc",
"cleanup_task_mac_unittest.mm",
"mac/keystone/ksadmin_unittest.cc",
"mac/privileged_helper/privileged_helper_unittests.mm",
"mac/setup/keystone_unittest.mm",
"mac/setup/ks_tickets_unittest.mm",
"mac/setup/setup_unittest.mm",
"mac/setup/wake_task_unittest.mm",
"policy/mac/managed_preference_policy_manager_impl_unittest.mm",
"policy/mac/managed_preference_policy_manager_unittest.cc",
"test/integration_tests_mac.h",
"test/integration_tests_mac.mm",
"util/util_mac_unittest.mm",
]
deps += [
":ks_ticket",
"//chrome/updater/mac:ksadmin_lib",
"//chrome/updater/mac:privileged_helper_sources",
"//chrome/updater/mac/client_lib:public_sources",
"//chrome/updater/mac/client_lib:unit_test_sources",
"//chrome/updater/net/mac/mojom",
"//third_party/ocmock",
]
frameworks = [
"Foundation.framework",
"Security.framework",
]
data += [
"//chrome/test/data/updater/CountingMetrics.plist",
"//chrome/test/data/updater/Keystone.ticketstore",
"//chrome/test/data/updater/Keystone.withlaunchservicechecker.ticketstore",
"//chrome/test/data/updater/Keystone.legacy.ticketstore",
"//chrome/test/data/updater/updater_setup_test_dmg.dmg",
"//chrome/test/data/updater/setup_test_preinstallfailure/.preinstall",
"//chrome/test/data/updater/setup_test_preinstallfailure/.install",
"//chrome/test/data/updater/setup_test_preinstallfailure/.postinstall",
"//chrome/test/data/updater/setup_test_preinstallfailure/marker.app",
"//chrome/test/data/updater/setup_test_postinstallfailure/.preinstall",
"//chrome/test/data/updater/setup_test_postinstallfailure/.install",
"//chrome/test/data/updater/setup_test_postinstallfailure/.postinstall",
"//chrome/test/data/updater/setup_test_postinstallfailure/marker.app",
"//chrome/test/data/updater/setup_test_installfailure/.preinstall",
"//chrome/test/data/updater/setup_test_installfailure/.install",
"//chrome/test/data/updater/setup_test_installfailure/.postinstall",
"//chrome/test/data/updater/setup_test_installfailure/marker.app",
"//chrome/test/data/updater/setup_test_envcheck/.install",
"//chrome/test/data/updater/setup_test_envcheck/marker.app",
"//chrome/test/data/updater/updater_qualification_app_dmg.crx",
"//third_party/updater/chrome_mac_universal/cipd/GoogleUpdater_test.app/Contents/MacOS/GoogleUpdater_test",
"//third_party/updater/chrome_mac_universal/cipd/GoogleUpdater_test.app/Contents/Info.plist",
"//third_party/updater/chrome_mac_universal/cipd/GoogleUpdater_test.app/Contents/Helpers/GoogleSoftwareUpdate.bundle/Contents/MacOS/GoogleSoftwareUpdate",
"//third_party/updater/chrome_mac_universal/cipd/GoogleUpdater_test.app/Contents/Helpers/GoogleSoftwareUpdate.bundle/Contents/Resources/GoogleSoftwareUpdateAgent.app/Contents/MacOS/GoogleSoftwareUpdateAgent",
"//third_party/updater/chrome_mac_universal/cipd/GoogleUpdater_test.app/Contents/Helpers/GoogleSoftwareUpdate.bundle/Contents/Resources/GoogleSoftwareUpdateAgent.app/Contents/Info.plist",
"//third_party/updater/chrome_mac_universal/cipd/GoogleUpdater_test.app/Contents/Helpers/GoogleSoftwareUpdate.bundle/Contents/Helpers/ksinstall",
"//third_party/updater/chrome_mac_universal/cipd/GoogleUpdater_test.app/Contents/Helpers/GoogleSoftwareUpdate.bundle/Contents/Helpers/ksadmin",
"//third_party/updater/chrome_mac_universal/cipd/GoogleUpdater_test.app/Contents/Helpers/GoogleSoftwareUpdate.bundle/Contents/Info.plist",
"//third_party/updater/chrome_mac_universal_prod/cipd/GoogleUpdater.app/Contents/CodeResources",
"//third_party/updater/chrome_mac_universal_prod/cipd/GoogleUpdater.app/Contents/Helpers/GoogleSoftwareUpdate.bundle/Contents/Helpers/ksadmin",
"//third_party/updater/chrome_mac_universal_prod/cipd/GoogleUpdater.app/Contents/Helpers/GoogleSoftwareUpdate.bundle/Contents/Helpers/ksinstall",
"//third_party/updater/chrome_mac_universal_prod/cipd/GoogleUpdater.app/Contents/Helpers/GoogleSoftwareUpdate.bundle/Contents/Info.plist",
"//third_party/updater/chrome_mac_universal_prod/cipd/GoogleUpdater.app/Contents/Helpers/GoogleSoftwareUpdate.bundle/Contents/MacOS/GoogleSoftwareUpdate",
"//third_party/updater/chrome_mac_universal_prod/cipd/GoogleUpdater.app/Contents/Helpers/GoogleSoftwareUpdate.bundle/Contents/MacOS/ksadmin",
"//third_party/updater/chrome_mac_universal_prod/cipd/GoogleUpdater.app/Contents/Helpers/GoogleSoftwareUpdate.bundle/Contents/Resources/GoogleSoftwareUpdateAgent.app/Contents/Info.plist",
"//third_party/updater/chrome_mac_universal_prod/cipd/GoogleUpdater.app/Contents/Helpers/GoogleSoftwareUpdate.bundle/Contents/Resources/GoogleSoftwareUpdateAgent.app/Contents/MacOS/GoogleSoftwareUpdateAgent",
"//third_party/updater/chrome_mac_universal_prod/cipd/GoogleUpdater.app/Contents/Helpers/GoogleSoftwareUpdate.bundle/Contents/Resources/GoogleSoftwareUpdateAgent.app/Contents/_CodeSignature",
"//third_party/updater/chrome_mac_universal_prod/cipd/GoogleUpdater.app/Contents/Helpers/GoogleSoftwareUpdate.bundle/Contents/_CodeSignature",
"//third_party/updater/chrome_mac_universal_prod/cipd/GoogleUpdater.app/Contents/Helpers/launcher",
"//third_party/updater/chrome_mac_universal_prod/cipd/GoogleUpdater.app/Contents/Info.plist",
"//third_party/updater/chrome_mac_universal_prod/cipd/GoogleUpdater.app/Contents/MacOS/GoogleUpdater",
"//third_party/updater/chrome_mac_universal_prod/cipd/GoogleUpdater.app/Contents/_CodeSignature",
]
data_deps += [
"//chrome/enterprise_companion/mac:enterprise_companion_bundle_test",
"//chrome/updater/mac:ksadmin_test",
"//chrome/updater/mac:updater_bundle_test",
"//chrome/updater/mac/client_lib/test_helpers/app_bundle:registration_test_app_bundle",
]
if (target_cpu == "arm64") {
data += [
"//third_party/updater/chromium_mac_arm64/cipd/ChromiumUpdater_test.app/Contents/MacOS/ChromiumUpdater_test",
"//third_party/updater/chromium_mac_arm64/cipd/ChromiumUpdater_test.app/Contents/Info.plist",
"//third_party/updater/chromium_mac_arm64/cipd/ChromiumUpdater_test.app/Contents/Helpers/ChromiumSoftwareUpdate.bundle/Contents/MacOS/ChromiumSoftwareUpdate",
"//third_party/updater/chromium_mac_arm64/cipd/ChromiumUpdater_test.app/Contents/Helpers/ChromiumSoftwareUpdate.bundle/Contents/Resources/ChromiumSoftwareUpdateAgent.app/Contents/MacOS/ChromiumSoftwareUpdateAgent",
"//third_party/updater/chromium_mac_arm64/cipd/ChromiumUpdater_test.app/Contents/Helpers/ChromiumSoftwareUpdate.bundle/Contents/Resources/ChromiumSoftwareUpdateAgent.app/Contents/Info.plist",
"//third_party/updater/chromium_mac_arm64/cipd/ChromiumUpdater_test.app/Contents/Helpers/ChromiumSoftwareUpdate.bundle/Contents/Helpers/ksinstall",
"//third_party/updater/chromium_mac_arm64/cipd/ChromiumUpdater_test.app/Contents/Helpers/ChromiumSoftwareUpdate.bundle/Contents/Helpers/ksadmin",
"//third_party/updater/chromium_mac_arm64/cipd/ChromiumUpdater_test.app/Contents/Helpers/ChromiumSoftwareUpdate.bundle/Contents/Info.plist",
]
}
if (target_cpu == "x64") {
data += [
"//third_party/updater/chromium_mac_amd64/cipd/ChromiumUpdater_test.app/Contents/MacOS/ChromiumUpdater_test",
"//third_party/updater/chromium_mac_amd64/cipd/ChromiumUpdater_test.app/Contents/Info.plist",
"//third_party/updater/chromium_mac_amd64/cipd/ChromiumUpdater_test.app/Contents/Helpers/ChromiumSoftwareUpdate.bundle/Contents/MacOS/ChromiumSoftwareUpdate",
"//third_party/updater/chromium_mac_amd64/cipd/ChromiumUpdater_test.app/Contents/Helpers/ChromiumSoftwareUpdate.bundle/Contents/Resources/ChromiumSoftwareUpdateAgent.app/Contents/MacOS/ChromiumSoftwareUpdateAgent",
"//third_party/updater/chromium_mac_amd64/cipd/ChromiumUpdater_test.app/Contents/Helpers/ChromiumSoftwareUpdate.bundle/Contents/Resources/ChromiumSoftwareUpdateAgent.app/Contents/Info.plist",
"//third_party/updater/chromium_mac_amd64/cipd/ChromiumUpdater_test.app/Contents/Helpers/ChromiumSoftwareUpdate.bundle/Contents/Helpers/ksinstall",
"//third_party/updater/chromium_mac_amd64/cipd/ChromiumUpdater_test.app/Contents/Helpers/ChromiumSoftwareUpdate.bundle/Contents/Helpers/ksadmin",
"//third_party/updater/chromium_mac_amd64/cipd/ChromiumUpdater_test.app/Contents/Helpers/ChromiumSoftwareUpdate.bundle/Contents/Info.plist",
]
}
}
if (is_linux) {
sources += [ "test/integration_tests_linux.cc" ]
data += [ "//chrome/test/data/updater/updater_qualification_app.crx" ]
data_deps += [
"//chrome/enterprise_companion:enterprise_companion_test",
"//chrome/updater/linux:updater_test",
]
libs = [ "systemd" ]
}
if (is_posix) {
sources += [
"app/server/posix/ipc_unittest.cc",
"util/posix_util_unittest.cc",
]
deps += [ "//chrome/updater/mojom" ]
}
}
if (is_win) {
copy("test_service_files") {
testonly = true
sources = [
"test/service/win/answer_uac.py",
"test/service/win/impersonate.py",
"test/service/win/proc_util.py",
"test/service/win/rpc_client.py",
"test/service/win/rpc_handler.py",
"test/service/win/run_command_as_standard_user.py",
"test/service/win/service_client.py",
"test/service/win/uac.py",
"test/service/win/ui.py",
"test/service/win/updater_test_service.py",
"test/service/win/updater_test_service_control.py",
]
outputs = [ "$root_build_dir/test_service/{{source_file_part}}" ]
}
}
# These tests are run serially since they mutate system state.
test("updater_tests") {
testonly = true
sources = [
"test/integration_test_commands_factory_user.cc",
"test/run_all_unittests.cc",
"test/test_scope_user.cc",
]
deps = [
":base",
":branding_header",
":unit_test_util_sources",
":updater_test_sources",
"//base/test:test_support",
"//chrome/common:constants",
"//testing/gtest",
]
if (is_mac) {
data_deps = [
"//chrome/updater/mac:updater_bundle_test",
"//chrome/updater/mac/client_lib/test_helpers/app_bundle:registration_test_app_bundle",
"//third_party/updater:old_updater",
]
}
if (is_win) {
deps += [ "//chrome/installer/util:with_no_strings" ]
data_deps = [
":test_service_files",
"//chrome/updater/win:updater_test",
"//third_party/updater:old_updater",
]
}
if (is_linux) {
data_deps = [ "//chrome/updater/linux:updater_test" ]
data_deps += [ "//third_party/updater:old_updater" ]
}
}
test("updater_tests_system") {
testonly = true
sources = [
"test/integration_test_commands_factory_system.cc",
"test/run_all_unittests.cc",
"test/test_scope_system.cc",
]
deps = [
":base",
":branding_header",
":unit_test_util_sources",
":updater_test_sources",
"//base/test:test_support",
"//chrome/common:constants",
"//testing/gtest",
]
data_deps = [ ":updater_integration_tests_helper" ]
if (is_mac) {
data_deps += [
"//chrome/updater/mac:updater_bundle_test",
"//chrome/updater/mac/client_lib/test_helpers/app_bundle:registration_test_app_bundle",
"//third_party/updater:old_updater",
]
}
if (is_win) {
deps += [ "//chrome/installer/util:with_no_strings" ]
data_deps += [
":test_service_files",
"//chrome/updater/win:updater_test",
"//third_party/updater:old_updater",
]
}
if (is_linux) {
data_deps += [ "//chrome/updater/linux:updater_test" ]
}
}
if (is_win) {
group("updater_tests_win_uac") {
testonly = true
data = [ "//testing/scripts/run_telemetry_as_googletest.py" ]
data_deps = [
":test_service_files",
":updater_tests",
"//testing:test_scripts_shared",
]
}
}
executable("updater_integration_tests_helper") {
testonly = true
sources = [
"test/integration_test_commands_factory_system.cc",
"test/integration_tests_helper.cc",
"test/test_scope_system.cc",
]
deps = [
":base",
":unit_test_util_sources",
":updater_test_sources",
"//base",
"//base/test:test_support",
"//chrome/common:constants",
"//testing/gtest",
"//url",
]
}
}