blob: 04f54ea683b5c451aba03951671b68b9a247e372 [file] [log] [blame]
[email protected]743530f2014-06-12 19:38:501# Copyright 2014 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
James Cook209256f2018-12-07 18:40:505import("//build/buildflag_header.gni")
Ben Pastenec60bf5022018-05-04 01:10:336import("//build/config/chromeos/rules.gni")
mukai6ba73552014-10-09 19:05:177import("//build/config/ui.gni")
Lutz Justen09c943a2018-04-13 01:49:198import("//testing/libfuzzer/fuzzer_test.gni")
qsrfb5251d12015-01-21 15:57:229import("//testing/test.gni")
[email protected]743530f2014-06-12 19:38:5010import("//third_party/protobuf/proto_library.gni")
11
A Olsen94579842018-10-10 19:22:3112assert(is_chromeos, "Non-Chrome-OS builds must not depend on //chromeos")
mukai327e5f52014-10-16 19:10:5213
A Olsen37962d2e2018-10-12 15:05:1814# Used by targets that compile into the implementation.
15config("chromeos_implementation") {
16 defines = [ "CHROMEOS_IMPLEMENTATION" ]
17}
18
James Cook209256f2018-12-07 18:40:5019buildflag_header("chromeos_buildflags") {
20 header = "chromeos_buildflags.h"
21 flags = [ "IS_CROS_CHROME_SDK=$is_cros_chrome_sdk" ]
22}
23
mukai6ba73552014-10-09 19:05:1724component("chromeos") {
A Olsen37962d2e2018-10-12 15:05:1825 configs += [
26 ":chromeos_implementation",
James Cookc3828a42018-11-28 23:33:2327 "//build/config/linux/nss:system_nss_no_ssl_config",
A Olsen37962d2e2018-10-12 15:05:1828 ]
scottmg34fb7e52014-12-03 23:27:2429 public_deps = [
A Olsen94579842018-10-10 19:22:3130 ":chromeos_constants",
31 ":chromeos_export",
A Olsen37962d2e2018-10-12 15:05:1832 ":policy_certificate_provider",
33 ":tools",
A Olsen94579842018-10-10 19:22:3134 "//chromeos/dbus",
A Olsen37962d2e2018-10-12 15:05:1835 "//chromeos/network",
A Olsen94579842018-10-10 19:22:3136 "//chromeos/settings",
scottmg34fb7e52014-12-03 23:27:2437 "//dbus",
mukai6ba73552014-10-09 19:05:1738 ]
39 deps = [
Kush Sinha719fb1b2018-03-19 19:29:5840 ":account_manager_proto",
mukai6ba73552014-10-09 19:05:1741 "//base",
Nico Webera3d0a422015-01-20 21:46:2142 "//base:i18n",
mukai6ba73552014-10-09 19:05:1743 "//base/third_party/dynamic_annotations",
Alexander Alekseev3f09a8f2018-05-03 02:52:1044 "//components/account_id",
reillyg4a849272015-02-20 21:38:4345 "//components/device_event_log",
tnagel51accc42016-12-28 12:00:5846 "//components/policy:cloud_policy_proto_generated_compile",
agrieved7a71c882015-11-20 19:53:2847 "//components/policy/proto",
stevenjb100c6202016-10-28 02:28:0048 "//components/pref_registry",
brettw9f7802a22016-01-30 06:40:1749 "//components/prefs",
alemate627f6532016-03-04 10:39:5450 "//components/user_manager",
nkostylev8d7d18d2015-01-28 11:25:0851 "//crypto:platform",
mukai6ba73552014-10-09 19:05:1752 "//google_apis",
Luum Habtemariamb30c8112018-06-25 21:51:2253 "//services/network/public/cpp:cpp",
mukai6ba73552014-10-09 19:05:1754 "//third_party/protobuf:protobuf_lite",
James Cooka7478252018-02-23 23:03:1155 "//ui/gfx/geometry", # For accelerometer.
mukai6ba73552014-10-09 19:05:1756 ]
teravest54ee2252017-03-17 14:18:1657 sources = [
58 "accelerometer/accelerometer_reader.cc",
59 "accelerometer/accelerometer_reader.h",
60 "accelerometer/accelerometer_types.cc",
61 "accelerometer/accelerometer_types.h",
Kush Sinha719fb1b2018-03-19 19:29:5862 "account_manager/account_manager.cc",
63 "account_manager/account_manager.h",
Kush Sinha74c38a02018-04-16 23:53:4464 "account_manager/account_manager_factory.cc",
65 "account_manager/account_manager_factory.h",
teravest54ee2252017-03-17 14:18:1666 "app_mode/kiosk_oem_manifest_parser.cc",
67 "app_mode/kiosk_oem_manifest_parser.h",
teravest54ee2252017-03-17 14:18:1668 "geolocation/geoposition.cc",
69 "geolocation/geoposition.h",
70 "geolocation/simple_geolocation_provider.cc",
71 "geolocation/simple_geolocation_provider.h",
72 "geolocation/simple_geolocation_request.cc",
73 "geolocation/simple_geolocation_request.h",
74 "geolocation/simple_geolocation_request_test_monitor.cc",
75 "geolocation/simple_geolocation_request_test_monitor.h",
76 "hugepage_text/hugepage_text.cc",
77 "hugepage_text/hugepage_text.h",
A Olsend994a4c2018-10-02 11:35:3078 "policy/weekly_time/time_utils.cc",
79 "policy/weekly_time/time_utils.h",
80 "policy/weekly_time/weekly_time.cc",
81 "policy/weekly_time/weekly_time.h",
82 "policy/weekly_time/weekly_time_interval.cc",
83 "policy/weekly_time/weekly_time_interval.h",
teravest54ee2252017-03-17 14:18:1684 "printing/ppd_cache.cc",
85 "printing/ppd_cache.h",
Justin Carlson781f77e212017-11-15 22:32:3186 "printing/ppd_line_reader.cc",
87 "printing/ppd_line_reader.h",
teravest54ee2252017-03-17 14:18:1688 "printing/ppd_provider.cc",
89 "printing/ppd_provider.h",
90 "printing/printer_configuration.cc",
91 "printing/printer_configuration.h",
92 "printing/printer_translator.cc",
93 "printing/printer_translator.h",
David Valleau03e6fa6b2018-01-19 02:54:2694 "printing/uri_components.cc",
95 "printing/uri_components.h",
teravest54ee2252017-03-17 14:18:1696 "process_proxy/process_output_watcher.cc",
97 "process_proxy/process_output_watcher.h",
98 "process_proxy/process_proxy.cc",
99 "process_proxy/process_proxy.h",
100 "process_proxy/process_proxy_registry.cc",
101 "process_proxy/process_proxy_registry.h",
squea15eba142017-04-25 15:41:36102 "system/cpu_temperature_reader.cc",
103 "system/cpu_temperature_reader.h",
teravest54ee2252017-03-17 14:18:16104 "system/devicemode.cc",
105 "system/devicemode.h",
106 "system/devicetype.cc",
107 "system/devicetype.h",
Pavol Markoac1f5612018-05-19 21:44:59108 "system/factory_ping_embargo_check.cc",
109 "system/factory_ping_embargo_check.h",
teravest54ee2252017-03-17 14:18:16110
111 # Used when running mash, both on Linux and on real devices.
112 "system/fake_statistics_provider.cc",
113 "system/fake_statistics_provider.h",
114 "system/name_value_pairs_parser.cc",
115 "system/name_value_pairs_parser.h",
116 "system/statistics_provider.cc",
117 "system/statistics_provider.h",
teravest54ee2252017-03-17 14:18:16118 "timezone/timezone_provider.cc",
119 "timezone/timezone_provider.h",
120 "timezone/timezone_request.cc",
121 "timezone/timezone_request.h",
122 "timezone/timezone_resolver.cc",
123 "timezone/timezone_resolver.h",
teravest54ee2252017-03-17 14:18:16124 ]
agrievec50a6542016-06-09 03:44:09125 if (current_cpu == "arm" || current_cpu == "x86") {
A Olsen37962d2e2018-10-12 15:05:18126 defines = [ "BINDER_IPC_32BIT" ]
hashimotoaa1465a2015-12-11 06:19:59127 }
mukai6ba73552014-10-09 19:05:17128}
129
A Olsen94579842018-10-10 19:22:31130source_set("chromeos_export") {
131 deps = [
132 "//base",
133 ]
134 sources = [
135 "chromeos_export.h",
136 ]
137}
138
139source_set("chromeos_constants") {
A Olsen37962d2e2018-10-12 15:05:18140 configs += [ ":chromeos_implementation" ]
A Olsen94579842018-10-10 19:22:31141 deps = [
142 ":chromeos_export",
143 "//base",
144 "//base:i18n",
Steven Bennettsb6cedf0e2019-01-07 17:01:23145 "//chromeos/dbus:constants",
A Olsen94579842018-10-10 19:22:31146 "//third_party/icu",
147 ]
148 sources = [
Steven Bennetts38e9bde22019-01-03 17:31:10149 "constants/chromeos_constants.cc",
150 "constants/chromeos_constants.h",
151 "constants/chromeos_features.cc",
152 "constants/chromeos_features.h",
153 "constants/chromeos_paths.cc",
154 "constants/chromeos_paths.h",
155 "constants/chromeos_pref_names.cc",
156 "constants/chromeos_pref_names.h",
157 "constants/chromeos_switches.cc",
158 "constants/chromeos_switches.h",
A Olsen94579842018-10-10 19:22:31159 ]
A Olsen94579842018-10-10 19:22:31160}
161
A Olsen37962d2e2018-10-12 15:05:18162source_set("policy_certificate_provider") {
163 configs += [ ":chromeos_implementation" ]
164 deps = [
165 ":chromeos_export",
166 "//base",
167 ]
168 sources = [
169 "policy_certificate_provider.h",
170 ]
171}
172
173source_set("tools") {
174 configs += [ ":chromeos_implementation" ]
175 deps = [
176 ":chromeos_export",
177 "//base",
178 ]
179 sources = [
180 "tools/variable_expander.cc",
181 "tools/variable_expander.h",
182 ]
A Olsen94579842018-10-10 19:22:31183}
184
skau65455b5a02016-08-03 20:16:38185# This must be a static library instead of a source set because some of the
brettwc4e6a0f2015-08-27 18:28:32186# files pull in things with dependencies that aren't linked in all cases.
187#
188# TODO this should probably be changed such that it links in all cases and
189# can be converted to a source set.
Brett Wilson16eb70c2015-08-22 21:08:09190static_library("test_support") {
mukai6ba73552014-10-09 19:05:17191 testonly = true
A Olsen94579842018-10-10 19:22:31192 public_deps = [
193 ":test_support_source_set",
194 ]
195}
196
197source_set("test_support_source_set") {
198 testonly = true
Brett Wilson817fec02015-08-22 20:36:49199 public_deps = [
mukai6ba73552014-10-09 19:05:17200 ":chromeos",
oshima3f959fa82016-05-02 18:42:57201 ]
202 deps = [
Steven Bennettsc5f108132019-01-09 20:20:34203 "//chromeos/attestation:test_support",
204 "//chromeos/cryptohome:test_support",
Steven Bennetts39046b32019-01-10 17:15:16205 "//chromeos/dbus:test_support",
Steven Bennetts0ac86392019-01-09 19:05:51206 "//chromeos/disks:test_support",
Steven Bennetts2e6eaf72019-01-04 16:52:39207 "//chromeos/login/auth:test_support",
208 "//chromeos/login/login_state:test_support",
Alexander Alekseev3f09a8f2018-05-03 02:52:10209 "//components/account_id",
oshima3f959fa82016-05-02 18:42:57210 "//google_apis",
211 "//net:test_support",
Luum Habtemariamb30c8112018-06-25 21:51:22212 "//services/network:test_support",
Brett Wilson817fec02015-08-22 20:36:49213 "//testing/gmock",
oshima3f959fa82016-05-02 18:42:57214 "//testing/gtest",
mukai6ba73552014-10-09 19:05:17215 ]
216 sources = [
mukai6ba73552014-10-09 19:05:17217 "network/fake_network_device_handler.cc",
218 "network/fake_network_device_handler.h",
219 "network/mock_managed_network_configuration_handler.cc",
220 "network/mock_managed_network_configuration_handler.h",
malaykeshav77a1ea02016-04-21 18:55:50221 "network/mock_network_device_handler.cc",
222 "network/mock_network_device_handler.h",
Alexander Hendrichb24296892018-08-01 08:18:15223 "network/mock_network_state_handler.cc",
224 "network/mock_network_state_handler.h",
khorimoto6c378ee2017-03-30 23:57:47225 "network/network_state_test.cc",
226 "network/network_state_test.h",
mukai6ba73552014-10-09 19:05:17227 "network/onc/onc_test_utils.cc",
228 "network/onc/onc_test_utils.h",
kumarniranjanf0973312017-05-20 00:00:34229 "network/portal_detector/mock_network_portal_detector.cc",
230 "network/portal_detector/mock_network_portal_detector.h",
Steven Bennettsfc6af1c2019-01-03 18:22:02231 "test/chromeos_test_utils.cc",
232 "test/chromeos_test_utils.h",
mukai6ba73552014-10-09 19:05:17233 ]
234}
235
236static_library("test_support_without_gmock") {
237 testonly = true
A Olsen94579842018-10-10 19:22:31238 public_deps = [
239 "//chromeos/dbus",
mukai6ba73552014-10-09 19:05:17240 ]
241}
242
243test("chromeos_unittests") {
244 configs += [
agrieve95ba4442016-04-25 15:47:13245 "//build/config/linux/dbus",
Nico Weber2023256d2018-08-28 17:44:57246 "//build/config/linux/nss:system_nss_no_ssl_config",
mukai6ba73552014-10-09 19:05:17247 ]
248 deps = [
James Cook209256f2018-12-07 18:40:50249 ":chromeos_buildflags",
agrieved7a71c882015-11-20 19:53:28250 ":test_support",
Roman Sorokin94a94e32017-11-29 13:11:21251 ":test_support_without_gmock",
mukai6ba73552014-10-09 19:05:17252 "//base/test:test_support",
Steven Bennettsc5f108132019-01-09 20:20:34253 "//chromeos/attestation:unit_tests",
Steven Bennettsfbcd25f2019-01-09 17:22:09254 "//chromeos/audio:unit_tests",
A Olsen94579842018-10-10 19:22:31255 "//chromeos/cryptohome:unit_tests",
Steven Bennettsa0eb0c22019-01-07 20:39:02256 "//chromeos/dbus:authpolicy_proto",
257 "//chromeos/dbus:cryptohome_proto",
258 "//chromeos/dbus:dbus",
259 "//chromeos/dbus:power_manager_proto",
A Olsen94579842018-10-10 19:22:31260 "//chromeos/dbus:unit_tests",
Steven Bennetts0b493ad2019-01-07 21:38:39261 "//chromeos/dbus/services:unit_tests",
Steven Bennetts0ac86392019-01-09 19:05:51262 "//chromeos/disks:unit_tests",
Steven Bennetts4bea3032019-01-03 19:33:18263 "//chromeos/login/auth:unit_tests",
264 "//chromeos/login/login_state:unit_tests",
A Olsen37962d2e2018-10-12 15:05:18265 "//chromeos/network:unit_tests",
Kyle Horimoto940d7df2018-03-17 01:00:23266 "//chromeos/services:unit_tests",
A Olsen94579842018-10-10 19:22:31267 "//chromeos/settings:unit_tests",
Steven Bennetts94c48062019-01-08 20:12:09268 "//chromeos/tpm:unit_tests",
Alexander Alekseev3f09a8f2018-05-03 02:52:10269 "//components/account_id",
mukai6ba73552014-10-09 19:05:17270 "//components/onc",
A Olsend994a4c2018-10-02 11:35:30271 "//components/policy:generated",
272 "//components/policy/proto",
brettw9f7802a22016-01-30 06:40:17273 "//components/prefs:test_support",
stevenjb83368882015-07-10 20:51:45274 "//components/proxy_config",
mukai6ba73552014-10-09 19:05:17275 "//crypto",
276 "//crypto:test_support",
277 "//dbus:test_support",
278 "//google_apis",
Ken Rockotf03d97c952018-07-04 22:08:10279 "//mojo/core/embedder",
mukai6ba73552014-10-09 19:05:17280 "//net",
281 "//net:test_support",
Luum Habtemariamb30c8112018-06-25 21:51:22282 "//services/network:test_support",
Jay Civelli1ba115722018-07-16 17:41:01283 "//services/network/public/cpp",
mukai6ba73552014-10-09 19:05:17284 "//testing/gmock",
285 "//testing/gtest",
jshin77e507b2015-04-24 01:13:15286 "//third_party/icu",
mukai6ba73552014-10-09 19:05:17287 "//url",
mukai6ba73552014-10-09 19:05:17288 ]
teravest54ee2252017-03-17 14:18:16289 sources = [
Kush Sinha719fb1b2018-03-19 19:29:58290 "account_manager/account_manager_unittest.cc",
teravest54ee2252017-03-17 14:18:16291 "app_mode/kiosk_oem_manifest_parser_unittest.cc",
teravest54ee2252017-03-17 14:18:16292 "geolocation/simple_geolocation_unittest.cc",
A Olsend994a4c2018-10-02 11:35:30293 "policy/weekly_time/time_utils_unittest.cc",
294 "policy/weekly_time/weekly_time_interval_unittest.cc",
295 "policy/weekly_time/weekly_time_unittest.cc",
teravest54ee2252017-03-17 14:18:16296 "printing/ppd_cache_unittest.cc",
Justin Carlson781f77e212017-11-15 22:32:31297 "printing/ppd_line_reader_unittest.cc",
teravest54ee2252017-03-17 14:18:16298 "printing/ppd_provider_unittest.cc",
Sean Kauff2bbe72018-05-23 01:05:02299 "printing/printer_configuration_unittest.cc",
teravest54ee2252017-03-17 14:18:16300 "printing/printer_translator_unittest.cc",
301 "process_proxy/process_output_watcher_unittest.cc",
302 "process_proxy/process_proxy_unittest.cc",
squea15eba142017-04-25 15:41:36303 "system/cpu_temperature_reader_unittest.cc",
Pavol Markoac1f5612018-05-19 21:44:59304 "system/factory_ping_embargo_check_unittest.cc",
teravest54ee2252017-03-17 14:18:16305 "system/name_value_pairs_parser_unittest.cc",
Steven Bennettsfc6af1c2019-01-03 18:22:02306 "test/run_all_unittests.cc",
teravest54ee2252017-03-17 14:18:16307 "timezone/timezone_unittest.cc",
Lutz Justen09c943a2018-04-13 01:49:19308 "tools/variable_expander_unittest.cc",
teravest54ee2252017-03-17 14:18:16309 ]
dpranke94c6fb22016-06-10 01:55:08310
311 data = [
312 "test/data/",
dpranke94c6fb22016-06-10 01:55:08313 ]
mukai6ba73552014-10-09 19:05:17314}
315
Ben Pastene70ce32d22018-09-10 22:30:52316# The following definitions only apply when building for a CrOS board (ie: not
317# linux-chromeos). See the following for reference:
318# https://chromium.googlesource.com/chromium/src/+/master/docs/chromeos_build_instructions.md
319# https://chromium.googlesource.com/chromiumos/docs/+/master/simple_chrome_workflow.md
James Cook209256f2018-12-07 18:40:50320if (is_cros_chrome_sdk) {
Ben Pastene4ab98652018-12-17 18:33:18321 generate_runner_script("cros_vm_launcher") {
Ben Pastenec1543c22018-05-04 23:39:43322 generated_script = "$root_build_dir/bin/launch_cros_vm"
Ben Pastene22d25c82018-08-06 20:18:34323
324 # Assume every time we build cros_vm_launcher, we also build chrome and
325 # want to deploy it to the VM.
326 deploy_chrome = true
Ben Pastenec1543c22018-05-04 23:39:43327 }
Ben Pastene9ec70f92018-05-14 21:09:22328
Ben Pastene4ab98652018-12-17 18:33:18329 # The sanity test's actual binary is baked into the OS image. All we need to
Ben Pastene9ec70f92018-05-14 21:09:22330 # do is build the test wrapper and build our own browser to push to the VM
331 # before testing it.
Ben Pastene4ab98652018-12-17 18:33:18332 generate_runner_script("cros_vm_sanity_test") {
Ben Pastene16882032018-09-21 01:16:39333 testonly = true
334 test_exe = "cros_vm_sanity_test"
Ben Pastene9ec70f92018-05-14 21:09:22335 generated_script = "$root_build_dir/bin/run_cros_vm_sanity_test"
Ben Pastened09dd692018-09-21 18:58:10336 runtime_deps_file = "$root_out_dir/cros_vm_sanity_test.runtime_deps"
Ben Pastene9ec70f92018-05-14 21:09:22337
Ben Pastene16882032018-09-21 01:16:39338 data_deps = [
339 ":cros_chrome_deploy",
340 "//:chromiumos_preflight", # Builds the browser.
341 ]
Ben Pastene9ec70f92018-05-14 21:09:22342 }
Ben Pastene2bc796b2018-08-03 03:02:00343
Ben Pastene33015a02018-09-28 18:59:14344 tast_test("chrome_login_tast_tests") {
345 tast_tests = [
346 "ui.ChromeLogin",
347 "ui.ChromeCrashLoggedIn",
348 "ui.ChromeCrashNotLoggedIn",
349 ]
350 }
351
James Cookc3828a42018-11-28 23:33:23352 # Tast test sources live in the Chromium OS repository.
353 # To diagnose tast failures or disable tests, see go/tast-failures
Ben Pastene09de3942018-10-02 18:06:42354 tast_test("chrome_all_tast_tests") {
Ben Pasteneacc68d72018-12-20 00:49:10355 tast_disabled_tests = [
Ben Pastene0f413082018-12-06 00:12:20356 # Disabled due to flake. https://crbug.com/909736
357 "ui.MashLogin",
Ben Pastene0f413082018-12-06 00:12:20358 ]
Ben Pasteneacc68d72018-12-20 00:49:10359 }
360 tast_test("chrome_kevin_tast_tests") {
361 # Tests that fail on Kevin devices.
362 tast_disabled_tests = [ "arc.Boot" ] # crbug.com/916367
Ben Pastene09de3942018-10-02 18:06:42363 }
364
Ben Pastene2bc796b2018-08-03 03:02:00365 group("cros_chrome_deploy") {
366 # The following run-time dependencies are needed to deploy chrome to a
367 # ChromeOS device. See the link for the full list:
368 # https://codesearch.chromium.org/chromium/src/third_party/chromite/lib/chrome_util.py?l=341
369 # Most of these are copy targets, for which GN doesn't add their outputs
370 # as runtime-deps. See the link below for more details:
371 # https://chromium.googlesource.com/chromium/src/+/master/tools/gn/docs/reference.md#actions-and-copies
372 data_deps = [
373 "//chrome:xdg_mime",
374 "//mojo/core:shared_library_arc32",
375 "//mojo/core:shared_library_arc64",
376 ]
377
378 # TODO(bpastene): Figure out what's generating resources/chromeos/ and
379 # declare it as a dep instead of adding the dir directly.
380 data = [
381 "$root_out_dir/resources/chromeos/",
382 ]
383 }
Ben Pastenec60bf5022018-05-04 01:10:33384}
385
Lutz Justen09c943a2018-04-13 01:49:19386fuzzer_test("variable_expander_fuzzer") {
387 sources = [
388 "tools/variable_expander_fuzzer.cc",
389 ]
390 seed_corpus = "//chromeos/test/data/variable_expander/fuzzer_corpus"
391 dict = "//chromeos/test/data/variable_expander/fuzzer.dict"
392 deps = [
393 ":chromeos",
394 "//base/test:test_support",
395 ]
396}
397
Steven Bennetts149a15b2018-07-19 17:33:36398proto_library("account_manager_proto") {
399 sources = [
400 "account_manager/tokens.proto",
401 ]
402
403 proto_out_dir = "chromeos/account_manager"
404}