BUILD.gn 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910
  1. # Copyright 2019 The Chromium Authors. All rights reserved.
  2. # Use of this source code is governed by a BSD-style license that can be
  3. # found in the LICENSE file.
  4. import("//build/config/chrome_build.gni")
  5. import("//build/config/python.gni")
  6. import("//build/config/sanitizers/sanitizers.gni")
  7. import("//build/util/process_version.gni")
  8. import("//chrome/updater/branding.gni")
  9. import("//components/crx_file/crx3.gni")
  10. import("//testing/test.gni")
  11. # Run 'gn check out\Default --check-generated //chrome/updater/*' every time
  12. # dependencies are modified until a presubmit is written to automatically
  13. # check that the C++ includes match the build dependency graph.
  14. # TODO(sorin): make the code build on Linux. https://crbug.com/1014320
  15. group("updater") {
  16. if (is_win) {
  17. deps = [ "//chrome/updater/win" ]
  18. }
  19. if (is_mac) {
  20. deps = [ "//chrome/updater/mac" ]
  21. }
  22. if (is_linux) {
  23. deps = [ "//chrome/updater/linux" ]
  24. }
  25. if (is_win || is_mac || is_linux) {
  26. deps += [
  27. "//chrome/updater/test/qualification_app",
  28. "//chrome/updater/tools",
  29. ]
  30. }
  31. }
  32. group("all") {
  33. testonly = true
  34. if (is_win || is_mac || is_linux) {
  35. deps = [
  36. ":updater",
  37. ":updater_tests",
  38. ":updater_tests_system",
  39. ]
  40. }
  41. }
  42. # Conditional build is needed, otherwise the analyze script on Linux
  43. # requires all targets and it is going to include the targets below.
  44. if (is_win || is_mac || is_linux) {
  45. source_set("base") {
  46. sources = [
  47. "action_handler.h",
  48. "activity.cc",
  49. "activity.h",
  50. "activity_impl.h",
  51. "app/app.cc",
  52. "app/app.h",
  53. "app/app_install.cc",
  54. "app/app_install.h",
  55. "app/app_recover.cc",
  56. "app/app_recover.h",
  57. "app/app_server.cc",
  58. "app/app_server.h",
  59. "app/app_uninstall.cc",
  60. "app/app_uninstall.h",
  61. "app/app_update.cc",
  62. "app/app_update.h",
  63. "app/app_utils.cc",
  64. "app/app_utils.h",
  65. "app/app_wake.cc",
  66. "app/app_wake.h",
  67. "auto_run_on_os_upgrade_task.cc",
  68. "auto_run_on_os_upgrade_task.h",
  69. "check_for_updates_task.cc",
  70. "check_for_updates_task.h",
  71. "configurator.cc",
  72. "configurator.h",
  73. "constants.cc",
  74. "constants.h",
  75. "crash_client.cc",
  76. "crash_client.h",
  77. "crash_reporter.cc",
  78. "crash_reporter.h",
  79. "crx_downloader_factory.h",
  80. "device_management/dm_cached_policy_info.cc",
  81. "device_management/dm_cached_policy_info.h",
  82. "device_management/dm_client.cc",
  83. "device_management/dm_client.h",
  84. "device_management/dm_message.cc",
  85. "device_management/dm_message.h",
  86. "device_management/dm_response_validator.cc",
  87. "device_management/dm_response_validator.h",
  88. "device_management/dm_storage.cc",
  89. "device_management/dm_storage.h",
  90. "device_management_task.cc",
  91. "device_management_task.h",
  92. "enum_traits.h",
  93. "external_constants.cc",
  94. "external_constants.h",
  95. "external_constants_default.cc",
  96. "external_constants_default.h",
  97. "installer.cc",
  98. "installer.h",
  99. "persisted_data.cc",
  100. "persisted_data.h",
  101. "policy/dm_policy_manager.cc",
  102. "policy/dm_policy_manager.h",
  103. "policy/manager.cc",
  104. "policy/manager.h",
  105. "policy/policy_manager.cc",
  106. "policy/policy_manager.h",
  107. "policy/service.cc",
  108. "policy/service.h",
  109. "prefs.cc",
  110. "prefs.h",
  111. "prefs_impl.h",
  112. "registration_data.cc",
  113. "registration_data.h",
  114. "remove_uninstalled_apps_task.cc",
  115. "remove_uninstalled_apps_task.h",
  116. "service_proxy_factory.h",
  117. "setup.h",
  118. "splash_screen.h",
  119. "tag.cc",
  120. "tag.h",
  121. "update_block_check.cc",
  122. "update_block_check.h",
  123. "update_service.cc",
  124. "update_service.h",
  125. "update_service_impl.cc",
  126. "update_service_impl.h",
  127. "update_service_impl_inactive.cc",
  128. "update_service_impl_inactive.h",
  129. "update_service_internal.h",
  130. "update_service_internal_impl.cc",
  131. "update_service_internal_impl.h",
  132. "update_service_internal_impl_inactive.cc",
  133. "update_service_internal_impl_inactive.h",
  134. "update_service_internal_impl_qualifying.cc",
  135. "update_service_internal_impl_qualifying.h",
  136. "update_usage_stats_task.cc",
  137. "update_usage_stats_task.h",
  138. "updater.cc",
  139. "updater.h",
  140. "updater_scope.cc",
  141. "updater_scope.h",
  142. "util.cc",
  143. "util.h",
  144. ]
  145. deps = [
  146. ":branding_header",
  147. ":constants_header",
  148. ":version_header",
  149. "//base",
  150. "//base:i18n",
  151. "//build:chromeos_buildflags",
  152. "//chrome/updater/protos:omaha_proto",
  153. "//components/crash/core/common:crash_key",
  154. "//components/crash/core/common:crash_key_lib",
  155. "//components/crx_file",
  156. "//components/policy/core/common",
  157. "//components/policy/proto",
  158. "//components/prefs",
  159. "//components/update_client",
  160. "//components/update_client:in_process_patcher",
  161. "//components/update_client:in_process_unzipper",
  162. "//components/version_info",
  163. "//crypto",
  164. "//third_party/boringssl",
  165. "//third_party/crashpad/crashpad/client",
  166. "//third_party/crashpad/crashpad/handler",
  167. "//url",
  168. ]
  169. if (is_posix) {
  170. sources += [ "remove_uninstalled_apps_task_posix.cc" ]
  171. }
  172. if (is_mac) {
  173. sources += [
  174. "activity_impl_mac.cc",
  175. "app/app_install_mac.mm",
  176. "app/server/mac/app_server.h",
  177. "app/server/mac/server.h",
  178. "app/server/mac/server.mm",
  179. "app/server/mac/service_delegate.h",
  180. "app/server/mac/service_delegate.mm",
  181. "app/server/mac/service_protocol.h",
  182. "app/server/mac/service_protocol.mm",
  183. "app/server/mac/update_service_wrappers.h",
  184. "app/server/mac/update_service_wrappers.mm",
  185. "device_management/dm_storage_mac.mm",
  186. "installer_mac.cc",
  187. "launchd_util.cc",
  188. "launchd_util.h",
  189. "mac/install_from_archive.h",
  190. "mac/install_from_archive.mm",
  191. "mac/mac_util.h",
  192. "mac/mac_util.mm",
  193. "mac/net/network.h",
  194. "mac/net/network_fetcher.h",
  195. "mac/net/network_fetcher.mm",
  196. "mac/setup/keystone.h",
  197. "mac/setup/keystone.mm",
  198. "mac/setup/ks_tickets.h",
  199. "mac/setup/ks_tickets.mm",
  200. "mac/setup/setup.h",
  201. "mac/setup/setup.mm",
  202. "mac/update_service_internal_proxy.h",
  203. "mac/update_service_internal_proxy.mm",
  204. "mac/update_service_proxy.h",
  205. "mac/update_service_proxy.mm",
  206. "mac/xpc_service_names.h",
  207. "mac/xpc_service_names.mm",
  208. "policy/mac/managed_preference_policy_manager.h",
  209. "policy/mac/managed_preference_policy_manager.mm",
  210. "policy/mac/managed_preference_policy_manager_impl.h",
  211. "policy/mac/managed_preference_policy_manager_impl.mm",
  212. "prefs_mac.mm",
  213. "setup_mac.mm",
  214. "update_usage_stats_task_mac.mm",
  215. "util_mac.mm",
  216. ]
  217. deps += [
  218. "//chrome/common/mac:launchd",
  219. "//mojo/public/cpp/platform",
  220. "//net",
  221. ]
  222. frameworks = [
  223. "AppKit.framework",
  224. "CoreServices.framework",
  225. "Foundation.framework",
  226. "ServiceManagement.framework",
  227. "SystemConfiguration.framework",
  228. ]
  229. }
  230. if (is_win) {
  231. sources += [
  232. "activity_impl_win.cc",
  233. "app/app_install_win.cc",
  234. "app/server/win/com_classes.cc",
  235. "app/server/win/com_classes.h",
  236. "app/server/win/com_classes_legacy.cc",
  237. "app/server/win/com_classes_legacy.h",
  238. "app/server/win/server.cc",
  239. "app/server/win/server.h",
  240. "app/server/win/service_main.cc",
  241. "app/server/win/service_main.h",
  242. "app/server/win/updater_legacy_idl.h",
  243. "app/server/win/wrl_classes.cc",
  244. "device_management/dm_storage_win.cc",
  245. "policy/win/group_policy_manager.cc",
  246. "policy/win/group_policy_manager.h",
  247. "prefs_win.cc",
  248. "remove_uninstalled_apps_task_win.cc",
  249. "setup_win.cc",
  250. "update_block_check_win.cc",
  251. "update_usage_stats_task_win.cc",
  252. "util_win.cc",
  253. "win/action_handler.cc",
  254. "win/app_command_runner.cc",
  255. "win/app_command_runner.h",
  256. "win/app_install_controller.cc",
  257. "win/install_progress_observer.cc",
  258. "win/install_progress_observer.h",
  259. "win/installer_api.cc",
  260. "win/installer_api.h",
  261. "win/manifest_util.cc",
  262. "win/manifest_util.h",
  263. "win/net/network.h",
  264. "win/net/network_fetcher.cc",
  265. "win/net/network_fetcher.h",
  266. "win/protocol_parser_xml.cc",
  267. "win/protocol_parser_xml.h",
  268. "win/scoped_handle.h",
  269. "win/scoped_impersonation.cc",
  270. "win/scoped_impersonation.h",
  271. "win/setup/setup.cc",
  272. "win/setup/setup.h",
  273. "win/setup/setup_util.cc",
  274. "win/setup/setup_util.h",
  275. "win/setup/uninstall.cc",
  276. "win/setup/uninstall.h",
  277. "win/task_scheduler.cc",
  278. "win/task_scheduler.h",
  279. "win/ui/complete_wnd.cc",
  280. "win/ui/complete_wnd.h",
  281. "win/ui/l10n_util.cc",
  282. "win/ui/l10n_util.h",
  283. "win/ui/owner_draw_controls.cc",
  284. "win/ui/owner_draw_controls.h",
  285. "win/ui/progress_wnd.cc",
  286. "win/ui/progress_wnd.h",
  287. "win/ui/splash_screen.cc",
  288. "win/ui/splash_screen.h",
  289. "win/ui/ui.cc",
  290. "win/ui/ui.h",
  291. "win/ui/ui_constants.cc",
  292. "win/ui/ui_constants.h",
  293. "win/ui/ui_ctls.h",
  294. "win/ui/ui_displayed_event.cc",
  295. "win/ui/ui_displayed_event.h",
  296. "win/ui/ui_util.cc",
  297. "win/ui/ui_util.h",
  298. "win/ui/yes_no_dialog.cc",
  299. "win/ui/yes_no_dialog.h",
  300. "win/update_service_internal_proxy.cc",
  301. "win/update_service_internal_proxy.h",
  302. "win/update_service_proxy.cc",
  303. "win/update_service_proxy.h",
  304. "win/user_info.cc",
  305. "win/user_info.h",
  306. "win/win_constants.cc",
  307. "win/win_constants.h",
  308. "win/win_util.cc",
  309. "win/win_util.h",
  310. "win/wrl_module_initializer.h",
  311. ]
  312. deps += [
  313. "//build:branding_buildflags",
  314. "//chrome/installer/util:constants",
  315. "//chrome/installer/util:metainstaller_utils",
  316. "//chrome/installer/util:work_item",
  317. "//chrome/updater/app/server/win:updater_idl_idl",
  318. "//chrome/updater/app/server/win:updater_internal_idl_idl",
  319. "//chrome/updater/app/server/win:updater_legacy_idl_idl",
  320. "//chrome/updater/win/ui/resources",
  321. "//chrome/updater/win/ui/resources:strings",
  322. "//components/winhttp",
  323. "//third_party/wtl",
  324. ]
  325. configs -= [ "//build/config/win:winver" ]
  326. configs += [
  327. "//chrome/updater/app/server/win:winver",
  328. "//chrome/updater/win:wrl_strict",
  329. ]
  330. defines = [ "SECURITY_WIN32" ]
  331. libs = [
  332. "msxml2.lib",
  333. "secur32.lib",
  334. "taskschd.lib",
  335. "wtsapi32.lib",
  336. ]
  337. }
  338. if (is_linux) {
  339. sources += [
  340. "activity_impl_linux.cc",
  341. "app/server/linux/server.cc",
  342. "app/server/linux/server.h",
  343. "linux/net/network.cc",
  344. "linux/net/network.h",
  345. "linux/setup/setup.h",
  346. "linux/update_service_internal_proxy.cc",
  347. "linux/update_service_proxy.cc",
  348. "prefs_linux.cc",
  349. "setup_linux.cc",
  350. "update_usage_stats_task_linux.cc",
  351. ]
  352. }
  353. }
  354. source_set("constants_header") {
  355. sources = [ "constants.h" ]
  356. deps = [
  357. "//base",
  358. "//components/update_client",
  359. ]
  360. }
  361. source_set("constants_prod") {
  362. sources = [
  363. "constants_prod.cc",
  364. "external_constants_prod.cc",
  365. ]
  366. deps = [
  367. ":base",
  368. ":constants_header",
  369. "//base",
  370. ]
  371. }
  372. source_set("constants_test") {
  373. sources = [
  374. "constants_test.cc",
  375. "external_constants_override.cc",
  376. "external_constants_override.h",
  377. ]
  378. deps = [
  379. ":base",
  380. ":branding_header",
  381. ":constants_header",
  382. ":version_header",
  383. "//base",
  384. "//components/crx_file",
  385. "//url",
  386. ]
  387. }
  388. process_version("version_header") {
  389. sources = [ "//chrome/VERSION" ]
  390. template_file = "updater_version.h.in"
  391. output = "$target_gen_dir/updater_version.h"
  392. }
  393. process_version("branding_header") {
  394. extra_args = [
  395. "-e",
  396. "BROWSER_NAME=\"$browser_name\"",
  397. "-e",
  398. "COMPANY_FULLNAME=\"$updater_company_full_name\"",
  399. "-e",
  400. "COMPANY_SHORTNAME=\"$updater_company_short_name\"",
  401. "-e",
  402. "COPYRIGHT=\"updater_copyright\"",
  403. "-e",
  404. "CRASH_PRODUCT_NAME=\"$crash_product_name\"",
  405. "-e",
  406. "CRASH_UPLOAD_URL=\"$crash_upload_url\"",
  407. "-e",
  408. "DEVICE_MANAGEMENT_SERVER_URL=\"$device_management_server_url\"",
  409. "-e",
  410. "HELP_CENTER_URL=\"$help_center_url\"",
  411. "-e",
  412. "KEYSTONE_NAME=\"$keystone_app_name\"",
  413. "-e",
  414. "PRIVILEGED_HELPER_NAME=\"$privileged_helper_name\"",
  415. "-e",
  416. "PRODUCT_FULLNAME=\"$updater_product_full_name\"",
  417. "-e",
  418. "MAC_BROWSER_BUNDLE_IDENTIFIER=\"$mac_browser_bundle_identifier\"",
  419. "-e",
  420. "MAC_BUNDLE_IDENTIFIER=\"$mac_updater_bundle_identifier\"",
  421. "-e",
  422. "UPDATE_CHECK_URL=\"$update_check_url\"",
  423. ]
  424. template_file = "updater_branding.h.in"
  425. output = "$target_gen_dir/updater_branding.h"
  426. }
  427. source_set("browser_sources") {
  428. sources = [
  429. "//chrome/updater/constants.cc",
  430. "//chrome/updater/constants.h",
  431. "//chrome/updater/enum_traits.h",
  432. "//chrome/updater/registration_data.cc",
  433. "//chrome/updater/registration_data.h",
  434. "//chrome/updater/tag.cc",
  435. "//chrome/updater/tag.h",
  436. "//chrome/updater/update_service.cc",
  437. "//chrome/updater/update_service.h",
  438. "//chrome/updater/updater_scope.cc",
  439. "//chrome/updater/updater_scope.h",
  440. "//chrome/updater/util.cc",
  441. "//chrome/updater/util.h",
  442. ]
  443. deps = [
  444. ":branding_header",
  445. ":version_header",
  446. "//base",
  447. "//components/update_client",
  448. "//url",
  449. ]
  450. if (is_win) {
  451. sources += [
  452. "//chrome/updater/util_win.cc",
  453. "//chrome/updater/win/scoped_handle.h",
  454. "//chrome/updater/win/user_info.cc",
  455. "//chrome/updater/win/user_info.h",
  456. "//chrome/updater/win/win_constants.cc",
  457. "//chrome/updater/win/win_constants.h",
  458. "//chrome/updater/win/win_util.cc",
  459. "//chrome/updater/win/win_util.h",
  460. ]
  461. }
  462. if (is_mac) {
  463. sources += [
  464. "//chrome/updater/app/server/mac/service_protocol.h",
  465. "//chrome/updater/app/server/mac/service_protocol.mm",
  466. "//chrome/updater/app/server/mac/update_service_wrappers.h",
  467. "//chrome/updater/app/server/mac/update_service_wrappers.mm",
  468. "//chrome/updater/constants_prod.cc",
  469. "//chrome/updater/mac/mac_util.h",
  470. "//chrome/updater/mac/mac_util.mm",
  471. "//chrome/updater/mac/privileged_helper/service_protocol.h",
  472. "//chrome/updater/mac/xpc_service_names.h",
  473. "//chrome/updater/mac/xpc_service_names.mm",
  474. "//chrome/updater/util_mac.mm",
  475. ]
  476. deps += [ "//chrome/common/mac:launchd" ]
  477. }
  478. visibility = [
  479. "//chrome/browser",
  480. "//chrome/browser/ui:ui",
  481. "//chrome/browser/updater:*",
  482. "//chrome/test:*",
  483. "//chrome/test:unit_tests",
  484. ]
  485. }
  486. if (is_mac || is_win) {
  487. crx3("updater_selfupdate_test_crx") {
  488. base_dir = "$root_build_dir"
  489. key = "test/data/selfupdate_test_key.der"
  490. output = "$root_build_dir/updater_selfupdate.crx3"
  491. testonly = true
  492. if (is_mac) {
  493. inputs = [
  494. "$root_build_dir/.install",
  495. "$root_build_dir/${updater_product_full_name}_test.app/Contents/Info.plist",
  496. "$root_build_dir/${updater_product_full_name}_test.app/Contents/MacOS/${updater_product_full_name}_test",
  497. "$root_build_dir/${updater_product_full_name}_test.app/Contents/Helpers/$keystone_app_name.bundle/Contents/MacOS/$keystone_app_name",
  498. "$root_build_dir/${updater_product_full_name}_test.app/Contents/Helpers/$keystone_app_name.bundle/Contents/Helpers/ksinstall",
  499. "$root_build_dir/${updater_product_full_name}_test.app/Contents/Helpers/$keystone_app_name.bundle/Contents/Helpers/ksadmin",
  500. "$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",
  501. "$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",
  502. "$root_build_dir/${updater_product_full_name}_test.app/Contents/Helpers/$keystone_app_name.bundle/Contents/Info.plist",
  503. "$root_build_dir/${updater_product_full_name}_test.app/Contents/PkgInfo",
  504. ]
  505. deps = [
  506. "//chrome/updater/mac:updater_bundle_test",
  507. "//chrome/updater/mac:updater_test_install_script",
  508. ]
  509. # Mac ASAN builds have an extra dylib that must be packaged in the CRX.
  510. if (is_asan) {
  511. inputs += [ "$root_build_dir/${updater_product_full_name}_test.app/Contents/MacOS/libclang_rt.asan_osx_dynamic.dylib" ]
  512. }
  513. }
  514. if (is_win) {
  515. inputs = [ "$root_build_dir/UpdaterSetup_test.exe" ]
  516. deps = [ "//chrome/updater/win/installer:installer_test" ]
  517. if (is_component_build) {
  518. inputs += [
  519. "$root_build_dir/base.dll",
  520. "$root_build_dir/ui_base.dll",
  521. ]
  522. if (is_debug) {
  523. data = [ "$root_build_dir/ucrtbased.dll" ]
  524. }
  525. deps += [ "//ui/base" ]
  526. }
  527. }
  528. }
  529. }
  530. source_set("updater_test_sources") {
  531. testonly = true
  532. sources = [
  533. "app/app_server_unittest.cc",
  534. "device_management/dm_client_unittest.cc",
  535. "device_management/dm_message_unittest.cc",
  536. "device_management/dm_policy_builder_for_testing.cc",
  537. "device_management/dm_policy_builder_for_testing.h",
  538. "device_management/dm_response_validator_unittest.cc",
  539. "device_management/dm_storage_unittest.cc",
  540. "enum_traits_unittest.cc",
  541. "external_constants_builder.cc",
  542. "external_constants_builder.h",
  543. "external_constants_builder_unittest.cc",
  544. "external_constants_override_unittest.cc",
  545. "persisted_data_unittest.cc",
  546. "policy/dm_policy_manager_unittest.cc",
  547. "policy/manager_unittest.cc",
  548. "policy/policy_manager_unittest.cc",
  549. "policy/service_unittest.cc",
  550. "prefs_unittest.cc",
  551. "tag_unittest.cc",
  552. "test/integration_test_commands.h",
  553. "test/integration_test_commands_system.cc",
  554. "test/integration_test_commands_user.cc",
  555. "test/integration_tests.cc",
  556. "test/integration_tests_impl.cc",
  557. "test/integration_tests_impl.h",
  558. "test/server.cc",
  559. "test/server.h",
  560. "test_scope.h",
  561. "unittest_util.cc",
  562. "unittest_util.h",
  563. "unittest_util_unittest.cc",
  564. "update_service_unittest.cc",
  565. "update_usage_stats_task_unittest.cc",
  566. "updater_scope_unittest.cc",
  567. "updater_unittest.cc",
  568. "util_unittest.cc",
  569. ]
  570. deps = [
  571. ":base",
  572. ":branding_header",
  573. ":constants_test",
  574. ":version_header",
  575. "//base",
  576. "//base/test:test_support",
  577. "//chrome/common:constants",
  578. "//chrome/updater/protos:omaha_proto",
  579. "//chrome/updater/tools:unittest",
  580. "//components/crx_file",
  581. "//components/policy/proto",
  582. "//components/prefs:test_support",
  583. "//components/update_client",
  584. "//net:test_support",
  585. "//testing/gmock",
  586. "//testing/gtest",
  587. "//third_party/crashpad/crashpad/client",
  588. "//third_party/re2",
  589. "//url",
  590. ]
  591. if (is_win) {
  592. sources += [
  593. "activity_impl_win_unittest.cc",
  594. "app/server/win/com_classes_legacy_unittest.cc",
  595. "auto_run_on_os_upgrade_task_unittest.cc",
  596. "policy/win/group_policy_manager_unittest.cc",
  597. "test/integration_tests_win.cc",
  598. "unittest_util_win.cc",
  599. "unittest_util_win.h",
  600. "util_win_unittest.cc",
  601. "win/app_command_runner_unittest.cc",
  602. "win/installer_api_unittest.cc",
  603. "win/manifest_util_unittest.cc",
  604. "win/net/network_unittest.cc",
  605. "win/protocol_parser_xml_unittest.cc",
  606. "win/setup/setup_util_unittest.cc",
  607. "win/tag_extractor_unittest.cc",
  608. "win/task_scheduler_unittest.cc",
  609. "win/ui/l10n_util_unittest.cc",
  610. "win/win_util_unittest.cc",
  611. ]
  612. deps += [
  613. "//chrome/updater/app/server/win:updater_idl_idl",
  614. "//chrome/updater/app/server/win:updater_internal_idl_idl",
  615. "//chrome/updater/app/server/win:updater_legacy_idl_idl",
  616. "//chrome/updater/win:tag_extractor",
  617. "//chrome/updater/win/test:test_executables",
  618. "//chrome/updater/win/test:test_strings",
  619. "//chrome/updater/win/ui/resources:strings",
  620. ]
  621. data_deps = [
  622. ":updater_selfupdate_test_crx",
  623. "//chrome/updater/win:updater",
  624. "//chrome/updater/win:updater_test",
  625. "//chrome/updater/win/installer:installer_test",
  626. "//chrome/updater/win/installer:installer_unittest",
  627. "//chrome/updater/win/test:updater_test_process",
  628. ]
  629. data = [
  630. "test/data/signed.exe",
  631. "test/data/signed.exe.gz",
  632. "test/data/tagged_encode_utf8.exe",
  633. "test/data/tagged_magic_utf16.exe",
  634. "//chrome/test/data/updater/OfflineManifest.gup",
  635. "//chrome/test/data/updater/updater_qualification_app_exe.crx",
  636. ]
  637. if (target_cpu == "x64") {
  638. data += [
  639. "//third_party/updater/chrome_win_x86_64/UpdaterSetup_test.exe",
  640. "//third_party/updater/chromium_win_x86_64/UpdaterSetup_test.exe",
  641. ]
  642. }
  643. if (target_cpu == "x86") {
  644. data += [
  645. "//third_party/updater/chrome_win_x86/UpdaterSetup_test.exe",
  646. "//third_party/updater/chromium_win_x86/UpdaterSetup_test.exe",
  647. ]
  648. }
  649. defines = [ "SECURITY_WIN32" ]
  650. libs = [
  651. "secur32.lib",
  652. "taskschd.lib",
  653. ]
  654. }
  655. if (is_mac) {
  656. sources += [
  657. "mac/keystone/ksadmin_unittest.cc",
  658. "mac/net/network_unittest.cc",
  659. "mac/scoped_xpc_service_mock.h",
  660. "mac/scoped_xpc_service_mock.mm",
  661. "mac/setup/ks_tickets_unittest.mm",
  662. "mac/setup/setup_unittest.mm",
  663. "mac/update_service_proxy_test.mm",
  664. "policy/mac/managed_preference_policy_manager_impl_unittest.mm",
  665. "policy/mac/managed_preference_policy_manager_unittest.cc",
  666. "test/integration_tests_mac.mm",
  667. "util_mac_unittest.mm",
  668. ]
  669. deps += [
  670. "//chrome/common/mac:launchd",
  671. "//chrome/updater/mac:ksadmin_lib",
  672. "//third_party/ocmock",
  673. ]
  674. data = [
  675. "//chrome/test/data/updater/Keystone.ticketstore",
  676. "//chrome/test/data/updater/Keystone.legacy.ticketstore",
  677. "//chrome/test/data/updater/updater_setup_test_dmg.dmg",
  678. "//chrome/test/data/updater/setup_test_preinstallfailure/.preinstall",
  679. "//chrome/test/data/updater/setup_test_preinstallfailure/.install",
  680. "//chrome/test/data/updater/setup_test_preinstallfailure/.postinstall",
  681. "//chrome/test/data/updater/setup_test_preinstallfailure/marker.app",
  682. "//chrome/test/data/updater/setup_test_postinstallfailure/.preinstall",
  683. "//chrome/test/data/updater/setup_test_postinstallfailure/.install",
  684. "//chrome/test/data/updater/setup_test_postinstallfailure/.postinstall",
  685. "//chrome/test/data/updater/setup_test_postinstallfailure/marker.app",
  686. "//chrome/test/data/updater/setup_test_installfailure/.preinstall",
  687. "//chrome/test/data/updater/setup_test_installfailure/.install",
  688. "//chrome/test/data/updater/setup_test_installfailure/.postinstall",
  689. "//chrome/test/data/updater/setup_test_installfailure/marker.app",
  690. "//chrome/test/data/updater/setup_test_envcheck/.install",
  691. "//chrome/test/data/updater/setup_test_envcheck/marker.app",
  692. "//chrome/test/data/updater/updater_qualification_app_dmg.crx",
  693. "//third_party/updater/chrome_mac_universal/GoogleUpdater_test.app/Contents/MacOS/GoogleUpdater_test",
  694. "//third_party/updater/chrome_mac_universal/GoogleUpdater_test.app/Contents/Info.plist",
  695. "//third_party/updater/chrome_mac_universal/GoogleUpdater_test.app/Contents/Helpers/GoogleSoftwareUpdate.bundle/Contents/MacOS/GoogleSoftwareUpdate",
  696. "//third_party/updater/chrome_mac_universal/GoogleUpdater_test.app/Contents/Helpers/GoogleSoftwareUpdate.bundle/Contents/Resources/GoogleSoftwareUpdateAgent.app/Contents/MacOS/GoogleSoftwareUpdateAgent",
  697. "//third_party/updater/chrome_mac_universal/GoogleUpdater_test.app/Contents/Helpers/GoogleSoftwareUpdate.bundle/Contents/Resources/GoogleSoftwareUpdateAgent.app/Contents/Info.plist",
  698. "//third_party/updater/chrome_mac_universal/GoogleUpdater_test.app/Contents/Helpers/GoogleSoftwareUpdate.bundle/Contents/Helpers/ksinstall",
  699. "//third_party/updater/chrome_mac_universal/GoogleUpdater_test.app/Contents/Helpers/GoogleSoftwareUpdate.bundle/Contents/Helpers/ksadmin",
  700. "//third_party/updater/chrome_mac_universal/GoogleUpdater_test.app/Contents/Helpers/GoogleSoftwareUpdate.bundle/Contents/Info.plist",
  701. ]
  702. data_deps = [
  703. ":updater_selfupdate_test_crx",
  704. "//chrome/updater/mac:ksadmin",
  705. "//chrome/updater/mac:updater_bundle_test",
  706. ]
  707. if (target_cpu == "arm64") {
  708. data += [
  709. "//third_party/updater/chromium_mac_arm64/ChromiumUpdater_test.app/Contents/MacOS/ChromiumUpdater_test",
  710. "//third_party/updater/chromium_mac_arm64/ChromiumUpdater_test.app/Contents/Info.plist",
  711. "//third_party/updater/chromium_mac_arm64/ChromiumUpdater_test.app/Contents/Helpers/ChromiumSoftwareUpdate.bundle/Contents/MacOS/ChromiumSoftwareUpdate",
  712. "//third_party/updater/chromium_mac_arm64/ChromiumUpdater_test.app/Contents/Helpers/ChromiumSoftwareUpdate.bundle/Contents/Resources/ChromiumSoftwareUpdateAgent.app/Contents/MacOS/ChromiumSoftwareUpdateAgent",
  713. "//third_party/updater/chromium_mac_arm64/ChromiumUpdater_test.app/Contents/Helpers/ChromiumSoftwareUpdate.bundle/Contents/Resources/ChromiumSoftwareUpdateAgent.app/Contents/Info.plist",
  714. "//third_party/updater/chromium_mac_arm64/ChromiumUpdater_test.app/Contents/Helpers/ChromiumSoftwareUpdate.bundle/Contents/Helpers/ksinstall",
  715. "//third_party/updater/chromium_mac_arm64/ChromiumUpdater_test.app/Contents/Helpers/ChromiumSoftwareUpdate.bundle/Contents/Helpers/ksadmin",
  716. "//third_party/updater/chromium_mac_arm64/ChromiumUpdater_test.app/Contents/Helpers/ChromiumSoftwareUpdate.bundle/Contents/Info.plist",
  717. ]
  718. }
  719. if (target_cpu == "x64") {
  720. data += [
  721. "//third_party/updater/chromium_mac_amd64/ChromiumUpdater_test.app/Contents/MacOS/ChromiumUpdater_test",
  722. "//third_party/updater/chromium_mac_amd64/ChromiumUpdater_test.app/Contents/Info.plist",
  723. "//third_party/updater/chromium_mac_amd64/ChromiumUpdater_test.app/Contents/Helpers/ChromiumSoftwareUpdate.bundle/Contents/MacOS/ChromiumSoftwareUpdate",
  724. "//third_party/updater/chromium_mac_amd64/ChromiumUpdater_test.app/Contents/Helpers/ChromiumSoftwareUpdate.bundle/Contents/Resources/ChromiumSoftwareUpdateAgent.app/Contents/MacOS/ChromiumSoftwareUpdateAgent",
  725. "//third_party/updater/chromium_mac_amd64/ChromiumUpdater_test.app/Contents/Helpers/ChromiumSoftwareUpdate.bundle/Contents/Resources/ChromiumSoftwareUpdateAgent.app/Contents/Info.plist",
  726. "//third_party/updater/chromium_mac_amd64/ChromiumUpdater_test.app/Contents/Helpers/ChromiumSoftwareUpdate.bundle/Contents/Helpers/ksinstall",
  727. "//third_party/updater/chromium_mac_amd64/ChromiumUpdater_test.app/Contents/Helpers/ChromiumSoftwareUpdate.bundle/Contents/Helpers/ksadmin",
  728. "//third_party/updater/chromium_mac_amd64/ChromiumUpdater_test.app/Contents/Helpers/ChromiumSoftwareUpdate.bundle/Contents/Info.plist",
  729. ]
  730. }
  731. }
  732. if (is_linux) {
  733. sources += [ "test/integration_tests_linux.cc" ]
  734. }
  735. }
  736. if (is_win) {
  737. copy("test_service_files") {
  738. testonly = true
  739. sources = [
  740. "test/service/win/answer_uac.py",
  741. "test/service/win/impersonate.py",
  742. "test/service/win/proc_util.py",
  743. "test/service/win/rpc_client.py",
  744. "test/service/win/rpc_handler.py",
  745. "test/service/win/run_command_as_standard_user.py",
  746. "test/service/win/service_client.py",
  747. "test/service/win/uac.py",
  748. "test/service/win/ui.py",
  749. "test/service/win/updater_test_service.py",
  750. "test/service/win/updater_test_service_control.py",
  751. ]
  752. outputs = [ "$root_build_dir/test_service/{{source_file_part}}" ]
  753. }
  754. }
  755. # These tests are run serially since they mutate system state.
  756. test("updater_tests") {
  757. testonly = true
  758. sources = [
  759. "run_all_unittests.cc",
  760. "test/integration_test_commands_factory_user.cc",
  761. "test_scope_user.cc",
  762. ]
  763. deps = [
  764. ":base",
  765. ":updater_test_sources",
  766. "//base/test:test_support",
  767. "//chrome/common:constants",
  768. "//testing/gtest",
  769. ]
  770. if (is_mac) {
  771. data_deps = [
  772. "//chrome/updater/mac:updater_bundle_test",
  773. "//third_party/updater:old_updater",
  774. ]
  775. }
  776. if (is_win) {
  777. deps += [ "//chrome/installer/util:with_no_strings" ]
  778. data_deps = [
  779. ":test_service_files",
  780. "//third_party/updater:old_updater",
  781. ]
  782. }
  783. }
  784. test("updater_tests_system") {
  785. testonly = true
  786. sources = [
  787. "run_all_unittests.cc",
  788. "test/integration_test_commands_factory_system.cc",
  789. "test_scope_system.cc",
  790. ]
  791. deps = [
  792. ":base",
  793. ":updater_test_sources",
  794. "//base/test:test_support",
  795. "//chrome/common:constants",
  796. "//testing/gtest",
  797. ]
  798. data_deps = [ ":updater_integration_tests_helper" ]
  799. if (is_mac) {
  800. data_deps += [
  801. "//chrome/updater/mac:updater_bundle_test",
  802. "//third_party/updater:old_updater",
  803. ]
  804. }
  805. if (is_win) {
  806. deps += [ "//chrome/installer/util:with_no_strings" ]
  807. data_deps += [
  808. ":test_service_files",
  809. "//third_party/updater:old_updater",
  810. ]
  811. }
  812. }
  813. if (is_win) {
  814. group("updater_tests_win_uac") {
  815. testonly = true
  816. data = [ "//testing/scripts/run_telemetry_as_googletest.py" ]
  817. data_deps = [
  818. ":test_service_files",
  819. ":updater_tests",
  820. "//testing:test_scripts_shared",
  821. ]
  822. }
  823. }
  824. executable("updater_integration_tests_helper") {
  825. testonly = true
  826. sources = [
  827. "test/integration_test_commands_factory_system.cc",
  828. "test/integration_tests_helper.cc",
  829. "test_scope_system.cc",
  830. ]
  831. deps = [
  832. ":base",
  833. ":updater_test_sources",
  834. "//base",
  835. "//base/test:test_support",
  836. "//chrome/common:constants",
  837. "//testing/gtest",
  838. "//url",
  839. ]
  840. }
  841. }