blob: f528bd2d18dc2faccc67cf42190d33633b0a8172 [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 ":tools",
Steven Bennettsc2da12d2019-01-10 18:29:4733 "//chromeos/geolocation",
A Olsen37962d2e2018-10-12 15:05:1834 "//chromeos/network",
A Olsen94579842018-10-10 19:22:3135 "//chromeos/settings",
Steven Bennettsc2da12d2019-01-10 18:29:4736 "//chromeos/timezone",
mukai6ba73552014-10-09 19:05:1737 ]
38 deps = [
Kush Sinha719fb1b2018-03-19 19:29:5839 ":account_manager_proto",
mukai6ba73552014-10-09 19:05:1740 "//base",
Nico Webera3d0a422015-01-20 21:46:2141 "//base:i18n",
reillyg4a849272015-02-20 21:38:4342 "//components/device_event_log",
agrieved7a71c882015-11-20 19:53:2843 "//components/policy/proto",
stevenjb100c6202016-10-28 02:28:0044 "//components/pref_registry",
brettw9f7802a22016-01-30 06:40:1745 "//components/prefs",
mukai6ba73552014-10-09 19:05:1746 "//google_apis",
Luum Habtemariamb30c8112018-06-25 21:51:2247 "//services/network/public/cpp:cpp",
mukai6ba73552014-10-09 19:05:1748 "//third_party/protobuf:protobuf_lite",
James Cooka7478252018-02-23 23:03:1149 "//ui/gfx/geometry", # For accelerometer.
mukai6ba73552014-10-09 19:05:1750 ]
teravest54ee2252017-03-17 14:18:1651 sources = [
52 "accelerometer/accelerometer_reader.cc",
53 "accelerometer/accelerometer_reader.h",
54 "accelerometer/accelerometer_types.cc",
55 "accelerometer/accelerometer_types.h",
Kush Sinha719fb1b2018-03-19 19:29:5856 "account_manager/account_manager.cc",
57 "account_manager/account_manager.h",
Kush Sinha74c38a02018-04-16 23:53:4458 "account_manager/account_manager_factory.cc",
59 "account_manager/account_manager_factory.h",
teravest54ee2252017-03-17 14:18:1660 "app_mode/kiosk_oem_manifest_parser.cc",
61 "app_mode/kiosk_oem_manifest_parser.h",
teravest54ee2252017-03-17 14:18:1662 "hugepage_text/hugepage_text.cc",
63 "hugepage_text/hugepage_text.h",
A Olsend994a4c2018-10-02 11:35:3064 "policy/weekly_time/time_utils.cc",
65 "policy/weekly_time/time_utils.h",
66 "policy/weekly_time/weekly_time.cc",
67 "policy/weekly_time/weekly_time.h",
68 "policy/weekly_time/weekly_time_interval.cc",
69 "policy/weekly_time/weekly_time_interval.h",
teravest54ee2252017-03-17 14:18:1670 "printing/ppd_cache.cc",
71 "printing/ppd_cache.h",
Justin Carlson781f77e212017-11-15 22:32:3172 "printing/ppd_line_reader.cc",
73 "printing/ppd_line_reader.h",
teravest54ee2252017-03-17 14:18:1674 "printing/ppd_provider.cc",
75 "printing/ppd_provider.h",
76 "printing/printer_configuration.cc",
77 "printing/printer_configuration.h",
78 "printing/printer_translator.cc",
79 "printing/printer_translator.h",
David Valleau03e6fa6b2018-01-19 02:54:2680 "printing/uri_components.cc",
81 "printing/uri_components.h",
teravest54ee2252017-03-17 14:18:1682 "process_proxy/process_output_watcher.cc",
83 "process_proxy/process_output_watcher.h",
84 "process_proxy/process_proxy.cc",
85 "process_proxy/process_proxy.h",
86 "process_proxy/process_proxy_registry.cc",
87 "process_proxy/process_proxy_registry.h",
squea15eba142017-04-25 15:41:3688 "system/cpu_temperature_reader.cc",
89 "system/cpu_temperature_reader.h",
teravest54ee2252017-03-17 14:18:1690 "system/devicemode.cc",
91 "system/devicemode.h",
92 "system/devicetype.cc",
93 "system/devicetype.h",
Pavol Markoac1f5612018-05-19 21:44:5994 "system/factory_ping_embargo_check.cc",
95 "system/factory_ping_embargo_check.h",
teravest54ee2252017-03-17 14:18:1696
97 # Used when running mash, both on Linux and on real devices.
98 "system/fake_statistics_provider.cc",
99 "system/fake_statistics_provider.h",
100 "system/name_value_pairs_parser.cc",
101 "system/name_value_pairs_parser.h",
102 "system/statistics_provider.cc",
103 "system/statistics_provider.h",
teravest54ee2252017-03-17 14:18:16104 ]
agrievec50a6542016-06-09 03:44:09105 if (current_cpu == "arm" || current_cpu == "x86") {
A Olsen37962d2e2018-10-12 15:05:18106 defines = [ "BINDER_IPC_32BIT" ]
hashimotoaa1465a2015-12-11 06:19:59107 }
mukai6ba73552014-10-09 19:05:17108}
109
A Olsen94579842018-10-10 19:22:31110source_set("chromeos_export") {
111 deps = [
112 "//base",
113 ]
114 sources = [
115 "chromeos_export.h",
116 ]
117}
118
119source_set("chromeos_constants") {
A Olsen37962d2e2018-10-12 15:05:18120 configs += [ ":chromeos_implementation" ]
A Olsen94579842018-10-10 19:22:31121 deps = [
122 ":chromeos_export",
123 "//base",
124 "//base:i18n",
Steven Bennettsb6cedf0e2019-01-07 17:01:23125 "//chromeos/dbus:constants",
A Olsen94579842018-10-10 19:22:31126 "//third_party/icu",
127 ]
128 sources = [
Steven Bennetts38e9bde22019-01-03 17:31:10129 "constants/chromeos_constants.cc",
130 "constants/chromeos_constants.h",
131 "constants/chromeos_features.cc",
132 "constants/chromeos_features.h",
133 "constants/chromeos_paths.cc",
134 "constants/chromeos_paths.h",
135 "constants/chromeos_pref_names.cc",
136 "constants/chromeos_pref_names.h",
137 "constants/chromeos_switches.cc",
138 "constants/chromeos_switches.h",
A Olsen94579842018-10-10 19:22:31139 ]
A Olsen94579842018-10-10 19:22:31140}
141
A Olsen37962d2e2018-10-12 15:05:18142source_set("policy_certificate_provider") {
143 configs += [ ":chromeos_implementation" ]
144 deps = [
145 ":chromeos_export",
146 "//base",
147 ]
148 sources = [
149 "policy_certificate_provider.h",
150 ]
151}
152
153source_set("tools") {
154 configs += [ ":chromeos_implementation" ]
155 deps = [
156 ":chromeos_export",
157 "//base",
158 ]
159 sources = [
160 "tools/variable_expander.cc",
161 "tools/variable_expander.h",
162 ]
A Olsen94579842018-10-10 19:22:31163}
164
skau65455b5a02016-08-03 20:16:38165# This must be a static library instead of a source set because some of the
brettwc4e6a0f2015-08-27 18:28:32166# files pull in things with dependencies that aren't linked in all cases.
167#
168# TODO this should probably be changed such that it links in all cases and
169# can be converted to a source set.
Brett Wilson16eb70c2015-08-22 21:08:09170static_library("test_support") {
mukai6ba73552014-10-09 19:05:17171 testonly = true
A Olsen94579842018-10-10 19:22:31172 public_deps = [
173 ":test_support_source_set",
174 ]
175}
176
177source_set("test_support_source_set") {
178 testonly = true
Brett Wilson817fec02015-08-22 20:36:49179 public_deps = [
mukai6ba73552014-10-09 19:05:17180 ":chromeos",
oshima3f959fa82016-05-02 18:42:57181 ]
182 deps = [
Steven Bennettsc5f108132019-01-09 20:20:34183 "//chromeos/attestation:test_support",
184 "//chromeos/cryptohome:test_support",
Steven Bennetts39046b32019-01-10 17:15:16185 "//chromeos/dbus:test_support",
Steven Bennetts0ac86392019-01-09 19:05:51186 "//chromeos/disks:test_support",
Steven Bennetts2e6eaf72019-01-04 16:52:39187 "//chromeos/login/auth:test_support",
188 "//chromeos/login/login_state:test_support",
oshima3f959fa82016-05-02 18:42:57189 "//google_apis",
190 "//net:test_support",
Luum Habtemariamb30c8112018-06-25 21:51:22191 "//services/network:test_support",
Brett Wilson817fec02015-08-22 20:36:49192 "//testing/gmock",
oshima3f959fa82016-05-02 18:42:57193 "//testing/gtest",
mukai6ba73552014-10-09 19:05:17194 ]
195 sources = [
mukai6ba73552014-10-09 19:05:17196 "network/fake_network_device_handler.cc",
197 "network/fake_network_device_handler.h",
198 "network/mock_managed_network_configuration_handler.cc",
199 "network/mock_managed_network_configuration_handler.h",
malaykeshav77a1ea02016-04-21 18:55:50200 "network/mock_network_device_handler.cc",
201 "network/mock_network_device_handler.h",
Alexander Hendrichb24296892018-08-01 08:18:15202 "network/mock_network_state_handler.cc",
203 "network/mock_network_state_handler.h",
khorimoto6c378ee2017-03-30 23:57:47204 "network/network_state_test.cc",
205 "network/network_state_test.h",
mukai6ba73552014-10-09 19:05:17206 "network/onc/onc_test_utils.cc",
207 "network/onc/onc_test_utils.h",
kumarniranjanf0973312017-05-20 00:00:34208 "network/portal_detector/mock_network_portal_detector.cc",
209 "network/portal_detector/mock_network_portal_detector.h",
Steven Bennettsfc6af1c2019-01-03 18:22:02210 "test/chromeos_test_utils.cc",
211 "test/chromeos_test_utils.h",
mukai6ba73552014-10-09 19:05:17212 ]
213}
214
mukai6ba73552014-10-09 19:05:17215test("chromeos_unittests") {
216 configs += [
agrieve95ba4442016-04-25 15:47:13217 "//build/config/linux/dbus",
Nico Weber2023256d2018-08-28 17:44:57218 "//build/config/linux/nss:system_nss_no_ssl_config",
mukai6ba73552014-10-09 19:05:17219 ]
220 deps = [
James Cook209256f2018-12-07 18:40:50221 ":chromeos_buildflags",
agrieved7a71c882015-11-20 19:53:28222 ":test_support",
mukai6ba73552014-10-09 19:05:17223 "//base/test:test_support",
Steven Bennettsc5f108132019-01-09 20:20:34224 "//chromeos/attestation:unit_tests",
Steven Bennettsfbcd25f2019-01-09 17:22:09225 "//chromeos/audio:unit_tests",
A Olsen94579842018-10-10 19:22:31226 "//chromeos/cryptohome:unit_tests",
Steven Bennettsa992e432019-01-11 00:21:12227 "//chromeos/dbus:test_support",
A Olsen94579842018-10-10 19:22:31228 "//chromeos/dbus:unit_tests",
Steven Bennetts0b493ad2019-01-07 21:38:39229 "//chromeos/dbus/services:unit_tests",
Steven Bennetts0ac86392019-01-09 19:05:51230 "//chromeos/disks:unit_tests",
Steven Bennettsc2da12d2019-01-10 18:29:47231 "//chromeos/geolocation:unit_tests",
Steven Bennetts4bea3032019-01-03 19:33:18232 "//chromeos/login/auth:unit_tests",
233 "//chromeos/login/login_state:unit_tests",
A Olsen37962d2e2018-10-12 15:05:18234 "//chromeos/network:unit_tests",
Kyle Horimoto940d7df2018-03-17 01:00:23235 "//chromeos/services:unit_tests",
A Olsen94579842018-10-10 19:22:31236 "//chromeos/settings:unit_tests",
Steven Bennettsc2da12d2019-01-10 18:29:47237 "//chromeos/timezone:unit_tests",
Steven Bennetts94c48062019-01-08 20:12:09238 "//chromeos/tpm:unit_tests",
mukai6ba73552014-10-09 19:05:17239 "//components/onc",
A Olsend994a4c2018-10-02 11:35:30240 "//components/policy:generated",
241 "//components/policy/proto",
brettw9f7802a22016-01-30 06:40:17242 "//components/prefs:test_support",
stevenjb83368882015-07-10 20:51:45243 "//components/proxy_config",
mukai6ba73552014-10-09 19:05:17244 "//dbus:test_support",
245 "//google_apis",
Ken Rockotf03d97c952018-07-04 22:08:10246 "//mojo/core/embedder",
mukai6ba73552014-10-09 19:05:17247 "//net",
248 "//net:test_support",
Luum Habtemariamb30c8112018-06-25 21:51:22249 "//services/network:test_support",
Jay Civelli1ba115722018-07-16 17:41:01250 "//services/network/public/cpp",
mukai6ba73552014-10-09 19:05:17251 "//testing/gmock",
252 "//testing/gtest",
jshin77e507b2015-04-24 01:13:15253 "//third_party/icu",
mukai6ba73552014-10-09 19:05:17254 "//url",
mukai6ba73552014-10-09 19:05:17255 ]
teravest54ee2252017-03-17 14:18:16256 sources = [
Kush Sinha719fb1b2018-03-19 19:29:58257 "account_manager/account_manager_unittest.cc",
teravest54ee2252017-03-17 14:18:16258 "app_mode/kiosk_oem_manifest_parser_unittest.cc",
A Olsend994a4c2018-10-02 11:35:30259 "policy/weekly_time/time_utils_unittest.cc",
260 "policy/weekly_time/weekly_time_interval_unittest.cc",
261 "policy/weekly_time/weekly_time_unittest.cc",
teravest54ee2252017-03-17 14:18:16262 "printing/ppd_cache_unittest.cc",
Justin Carlson781f77e212017-11-15 22:32:31263 "printing/ppd_line_reader_unittest.cc",
teravest54ee2252017-03-17 14:18:16264 "printing/ppd_provider_unittest.cc",
Sean Kauff2bbe72018-05-23 01:05:02265 "printing/printer_configuration_unittest.cc",
teravest54ee2252017-03-17 14:18:16266 "printing/printer_translator_unittest.cc",
267 "process_proxy/process_output_watcher_unittest.cc",
268 "process_proxy/process_proxy_unittest.cc",
squea15eba142017-04-25 15:41:36269 "system/cpu_temperature_reader_unittest.cc",
Pavol Markoac1f5612018-05-19 21:44:59270 "system/factory_ping_embargo_check_unittest.cc",
teravest54ee2252017-03-17 14:18:16271 "system/name_value_pairs_parser_unittest.cc",
Steven Bennettsfc6af1c2019-01-03 18:22:02272 "test/run_all_unittests.cc",
Lutz Justen09c943a2018-04-13 01:49:19273 "tools/variable_expander_unittest.cc",
teravest54ee2252017-03-17 14:18:16274 ]
dpranke94c6fb22016-06-10 01:55:08275
276 data = [
277 "test/data/",
dpranke94c6fb22016-06-10 01:55:08278 ]
mukai6ba73552014-10-09 19:05:17279}
280
Ben Pastene70ce32d22018-09-10 22:30:52281# The following definitions only apply when building for a CrOS board (ie: not
282# linux-chromeos). See the following for reference:
283# https://chromium.googlesource.com/chromium/src/+/master/docs/chromeos_build_instructions.md
284# https://chromium.googlesource.com/chromiumos/docs/+/master/simple_chrome_workflow.md
James Cook209256f2018-12-07 18:40:50285if (is_cros_chrome_sdk) {
Ben Pastene4ab98652018-12-17 18:33:18286 generate_runner_script("cros_vm_launcher") {
Ben Pastenec1543c22018-05-04 23:39:43287 generated_script = "$root_build_dir/bin/launch_cros_vm"
Ben Pastene22d25c82018-08-06 20:18:34288
289 # Assume every time we build cros_vm_launcher, we also build chrome and
290 # want to deploy it to the VM.
291 deploy_chrome = true
Ben Pastenec1543c22018-05-04 23:39:43292 }
Ben Pastene9ec70f92018-05-14 21:09:22293
Ben Pastene4ab98652018-12-17 18:33:18294 # The sanity test's actual binary is baked into the OS image. All we need to
Ben Pastene9ec70f92018-05-14 21:09:22295 # do is build the test wrapper and build our own browser to push to the VM
296 # before testing it.
Ben Pastene4ab98652018-12-17 18:33:18297 generate_runner_script("cros_vm_sanity_test") {
Ben Pastene16882032018-09-21 01:16:39298 testonly = true
299 test_exe = "cros_vm_sanity_test"
Ben Pastene9ec70f92018-05-14 21:09:22300 generated_script = "$root_build_dir/bin/run_cros_vm_sanity_test"
Ben Pastened09dd692018-09-21 18:58:10301 runtime_deps_file = "$root_out_dir/cros_vm_sanity_test.runtime_deps"
Ben Pastene9ec70f92018-05-14 21:09:22302
Ben Pastene16882032018-09-21 01:16:39303 data_deps = [
304 ":cros_chrome_deploy",
305 "//:chromiumos_preflight", # Builds the browser.
306 ]
Ben Pastene9ec70f92018-05-14 21:09:22307 }
Ben Pastene2bc796b2018-08-03 03:02:00308
Ben Pastene33015a02018-09-28 18:59:14309 tast_test("chrome_login_tast_tests") {
310 tast_tests = [
311 "ui.ChromeLogin",
312 "ui.ChromeCrashLoggedIn",
313 "ui.ChromeCrashNotLoggedIn",
314 ]
315 }
316
James Cookc3828a42018-11-28 23:33:23317 # Tast test sources live in the Chromium OS repository.
318 # To diagnose tast failures or disable tests, see go/tast-failures
Ben Pastene09de3942018-10-02 18:06:42319 tast_test("chrome_all_tast_tests") {
Ben Pasteneacc68d72018-12-20 00:49:10320 tast_disabled_tests = [
Ben Pastene0f413082018-12-06 00:12:20321 # Disabled due to flake. https://crbug.com/909736
322 "ui.MashLogin",
Ben Pastene0f413082018-12-06 00:12:20323 ]
Ben Pasteneacc68d72018-12-20 00:49:10324 }
325 tast_test("chrome_kevin_tast_tests") {
326 # Tests that fail on Kevin devices.
327 tast_disabled_tests = [ "arc.Boot" ] # crbug.com/916367
Ben Pastene09de3942018-10-02 18:06:42328 }
329
Ben Pastene2bc796b2018-08-03 03:02:00330 group("cros_chrome_deploy") {
331 # The following run-time dependencies are needed to deploy chrome to a
332 # ChromeOS device. See the link for the full list:
333 # https://codesearch.chromium.org/chromium/src/third_party/chromite/lib/chrome_util.py?l=341
334 # Most of these are copy targets, for which GN doesn't add their outputs
335 # as runtime-deps. See the link below for more details:
336 # https://chromium.googlesource.com/chromium/src/+/master/tools/gn/docs/reference.md#actions-and-copies
337 data_deps = [
338 "//chrome:xdg_mime",
339 "//mojo/core:shared_library_arc32",
340 "//mojo/core:shared_library_arc64",
341 ]
342
343 # TODO(bpastene): Figure out what's generating resources/chromeos/ and
344 # declare it as a dep instead of adding the dir directly.
345 data = [
346 "$root_out_dir/resources/chromeos/",
347 ]
348 }
Ben Pastenec60bf5022018-05-04 01:10:33349}
350
Lutz Justen09c943a2018-04-13 01:49:19351fuzzer_test("variable_expander_fuzzer") {
352 sources = [
353 "tools/variable_expander_fuzzer.cc",
354 ]
355 seed_corpus = "//chromeos/test/data/variable_expander/fuzzer_corpus"
356 dict = "//chromeos/test/data/variable_expander/fuzzer.dict"
357 deps = [
358 ":chromeos",
359 "//base/test:test_support",
360 ]
361}
362
Steven Bennetts149a15b2018-07-19 17:33:36363proto_library("account_manager_proto") {
364 sources = [
365 "account_manager/tokens.proto",
366 ]
367
368 proto_out_dir = "chromeos/account_manager"
369}