blob: 13c0d280abc27d416cc493dbff8efd7facefeea1 [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")
qsrfb5251d12015-01-21 15:57:228import("//testing/test.gni")
[email protected]743530f2014-06-12 19:38:509import("//third_party/protobuf/proto_library.gni")
10
A Olsen94579842018-10-10 19:22:3111assert(is_chromeos, "Non-Chrome-OS builds must not depend on //chromeos")
mukai327e5f52014-10-16 19:10:5212
A Olsen37962d2e2018-10-12 15:05:1813# Used by targets that compile into the implementation.
14config("chromeos_implementation") {
15 defines = [ "CHROMEOS_IMPLEMENTATION" ]
16}
17
James Cook209256f2018-12-07 18:40:5018buildflag_header("chromeos_buildflags") {
19 header = "chromeos_buildflags.h"
20 flags = [ "IS_CROS_CHROME_SDK=$is_cros_chrome_sdk" ]
21}
22
mukai6ba73552014-10-09 19:05:1723component("chromeos") {
A Olsen37962d2e2018-10-12 15:05:1824 configs += [
25 ":chromeos_implementation",
James Cookc3828a42018-11-28 23:33:2326 "//build/config/linux/nss:system_nss_no_ssl_config",
A Olsen37962d2e2018-10-12 15:05:1827 ]
scottmg34fb7e52014-12-03 23:27:2428 public_deps = [
Steven Bennetts37852ef2019-03-06 00:32:2329 "//chromeos/constants",
mukai6ba73552014-10-09 19:05:1730 ]
31 deps = [
Steven Bennettscc799d42019-01-11 19:31:4032 ":chromeos_export",
mukai6ba73552014-10-09 19:05:1733 "//base",
Nico Webera3d0a422015-01-20 21:46:2134 "//base:i18n",
Abhishek Bhardwajd98628e2019-02-27 03:17:2135 "//chromeos/dbus",
Steven Bennetts37852ef2019-03-06 00:32:2336 "//chromeos/dbus/constants",
agrieved7a71c882015-11-20 19:53:2837 "//components/policy/proto",
mukai6ba73552014-10-09 19:05:1738 "//google_apis",
Abhishek Bhardwajd98628e2019-02-27 03:17:2139 "//services/device/public/mojom",
Luum Habtemariamb30c8112018-06-25 21:51:2240 "//services/network/public/cpp:cpp",
Abhishek Bhardwajd98628e2019-02-27 03:17:2141 "//services/service_manager/public/cpp",
mukai6ba73552014-10-09 19:05:1742 "//third_party/protobuf:protobuf_lite",
mukai6ba73552014-10-09 19:05:1743 ]
teravest54ee2252017-03-17 14:18:1644 sources = [
teravest54ee2252017-03-17 14:18:1645 "app_mode/kiosk_oem_manifest_parser.cc",
46 "app_mode/kiosk_oem_manifest_parser.h",
teravest54ee2252017-03-17 14:18:1647 "hugepage_text/hugepage_text.cc",
48 "hugepage_text/hugepage_text.h",
A Olsend994a4c2018-10-02 11:35:3049 "policy/weekly_time/time_utils.cc",
50 "policy/weekly_time/time_utils.h",
51 "policy/weekly_time/weekly_time.cc",
52 "policy/weekly_time/weekly_time.h",
53 "policy/weekly_time/weekly_time_interval.cc",
54 "policy/weekly_time/weekly_time_interval.h",
Luum Habtemariam2cbe8352019-01-25 20:57:5255 "printing/epson_driver_matching.cc",
56 "printing/epson_driver_matching.h",
teravest54ee2252017-03-17 14:18:1657 "printing/ppd_cache.cc",
58 "printing/ppd_cache.h",
Justin Carlson781f77e212017-11-15 22:32:3159 "printing/ppd_line_reader.cc",
60 "printing/ppd_line_reader.h",
teravest54ee2252017-03-17 14:18:1661 "printing/ppd_provider.cc",
62 "printing/ppd_provider.h",
63 "printing/printer_configuration.cc",
64 "printing/printer_configuration.h",
65 "printing/printer_translator.cc",
66 "printing/printer_translator.h",
David Valleau03e6fa6b2018-01-19 02:54:2667 "printing/uri_components.cc",
68 "printing/uri_components.h",
teravest54ee2252017-03-17 14:18:1669 "process_proxy/process_output_watcher.cc",
70 "process_proxy/process_output_watcher.h",
71 "process_proxy/process_proxy.cc",
72 "process_proxy/process_proxy.h",
73 "process_proxy/process_proxy_registry.cc",
74 "process_proxy/process_proxy_registry.h",
squea15eba142017-04-25 15:41:3675 "system/cpu_temperature_reader.cc",
76 "system/cpu_temperature_reader.h",
Abhishek Bhardwajd98628e2019-02-27 03:17:2177 "system/dark_resume_controller.cc",
78 "system/dark_resume_controller.h",
teravest54ee2252017-03-17 14:18:1679 "system/devicemode.cc",
80 "system/devicemode.h",
Pavol Markoac1f5612018-05-19 21:44:5981 "system/factory_ping_embargo_check.cc",
82 "system/factory_ping_embargo_check.h",
teravest54ee2252017-03-17 14:18:1683
84 # Used when running mash, both on Linux and on real devices.
85 "system/fake_statistics_provider.cc",
86 "system/fake_statistics_provider.h",
87 "system/name_value_pairs_parser.cc",
88 "system/name_value_pairs_parser.h",
89 "system/statistics_provider.cc",
90 "system/statistics_provider.h",
teravest54ee2252017-03-17 14:18:1691 ]
agrievec50a6542016-06-09 03:44:0992 if (current_cpu == "arm" || current_cpu == "x86") {
A Olsen37962d2e2018-10-12 15:05:1893 defines = [ "BINDER_IPC_32BIT" ]
hashimotoaa1465a2015-12-11 06:19:5994 }
mukai6ba73552014-10-09 19:05:1795}
96
A Olsen94579842018-10-10 19:22:3197source_set("chromeos_export") {
98 deps = [
99 "//base",
100 ]
101 sources = [
102 "chromeos_export.h",
103 ]
104}
105
skau65455b5a02016-08-03 20:16:38106# This must be a static library instead of a source set because some of the
brettwc4e6a0f2015-08-27 18:28:32107# files pull in things with dependencies that aren't linked in all cases.
108#
109# TODO this should probably be changed such that it links in all cases and
110# can be converted to a source set.
Brett Wilson16eb70c2015-08-22 21:08:09111static_library("test_support") {
mukai6ba73552014-10-09 19:05:17112 testonly = true
A Olsen94579842018-10-10 19:22:31113 public_deps = [
114 ":test_support_source_set",
115 ]
116}
117
118source_set("test_support_source_set") {
119 testonly = true
Brett Wilson817fec02015-08-22 20:36:49120 public_deps = [
mukai6ba73552014-10-09 19:05:17121 ":chromeos",
Steven Bennetts8e97939f2019-01-11 16:11:31122 ":test_utils",
oshima3f959fa82016-05-02 18:42:57123 ]
124 deps = [
Steven Bennettsc5f108132019-01-09 20:20:34125 "//chromeos/attestation:test_support",
126 "//chromeos/cryptohome:test_support",
Steven Bennetts39046b32019-01-10 17:15:16127 "//chromeos/dbus:test_support",
Steven Bennetts0ac86392019-01-09 19:05:51128 "//chromeos/disks:test_support",
Steven Bennetts2e6eaf72019-01-04 16:52:39129 "//chromeos/login/auth:test_support",
130 "//chromeos/login/login_state:test_support",
Steven Bennetts036b9b62019-01-11 17:47:57131 "//chromeos/network:test_support",
A Olsen6c0bcf32019-03-26 19:35:16132 "//chromeos/tpm:test_support",
oshima3f959fa82016-05-02 18:42:57133 "//google_apis",
134 "//net:test_support",
Luum Habtemariamb30c8112018-06-25 21:51:22135 "//services/network:test_support",
Brett Wilson817fec02015-08-22 20:36:49136 "//testing/gmock",
oshima3f959fa82016-05-02 18:42:57137 "//testing/gtest",
mukai6ba73552014-10-09 19:05:17138 ]
Steven Bennetts8e97939f2019-01-11 16:11:31139}
140
141source_set("test_utils") {
142 deps = [
143 "//base",
144 ]
mukai6ba73552014-10-09 19:05:17145 sources = [
Steven Bennettsfc6af1c2019-01-03 18:22:02146 "test/chromeos_test_utils.cc",
147 "test/chromeos_test_utils.h",
mukai6ba73552014-10-09 19:05:17148 ]
149}
150
mukai6ba73552014-10-09 19:05:17151test("chromeos_unittests") {
152 configs += [
agrieve95ba4442016-04-25 15:47:13153 "//build/config/linux/dbus",
Nico Weber2023256d2018-08-28 17:44:57154 "//build/config/linux/nss:system_nss_no_ssl_config",
mukai6ba73552014-10-09 19:05:17155 ]
156 deps = [
James Cook209256f2018-12-07 18:40:50157 ":chromeos_buildflags",
agrieved7a71c882015-11-20 19:53:28158 ":test_support",
mukai6ba73552014-10-09 19:05:17159 "//base/test:test_support",
Steven Bennettsc5f108132019-01-09 20:20:34160 "//chromeos/attestation:unit_tests",
Steven Bennettsfbcd25f2019-01-09 17:22:09161 "//chromeos/audio:unit_tests",
A Olsen94579842018-10-10 19:22:31162 "//chromeos/cryptohome:unit_tests",
Steven Bennettsa992e432019-01-11 00:21:12163 "//chromeos/dbus:test_support",
A Olsen94579842018-10-10 19:22:31164 "//chromeos/dbus:unit_tests",
Steven Bennetts0b493ad2019-01-07 21:38:39165 "//chromeos/dbus/services:unit_tests",
Steven Bennetts0ac86392019-01-09 19:05:51166 "//chromeos/disks:unit_tests",
Steven Bennettsc2da12d2019-01-10 18:29:47167 "//chromeos/geolocation:unit_tests",
Steven Bennetts4bea3032019-01-03 19:33:18168 "//chromeos/login/auth:unit_tests",
169 "//chromeos/login/login_state:unit_tests",
Steven Bennetts8e97939f2019-01-11 16:11:31170 "//chromeos/network:test_support",
A Olsen37962d2e2018-10-12 15:05:18171 "//chromeos/network:unit_tests",
Kyle Horimoto940d7df2018-03-17 01:00:23172 "//chromeos/services:unit_tests",
A Olsen94579842018-10-10 19:22:31173 "//chromeos/settings:unit_tests",
Steven Bennettsc2da12d2019-01-10 18:29:47174 "//chromeos/timezone:unit_tests",
Steven Bennetts94c48062019-01-08 20:12:09175 "//chromeos/tpm:unit_tests",
mukai6ba73552014-10-09 19:05:17176 "//components/onc",
A Olsend994a4c2018-10-02 11:35:30177 "//components/policy:generated",
178 "//components/policy/proto",
brettw9f7802a22016-01-30 06:40:17179 "//components/prefs:test_support",
stevenjb83368882015-07-10 20:51:45180 "//components/proxy_config",
mukai6ba73552014-10-09 19:05:17181 "//dbus:test_support",
182 "//google_apis",
Ken Rockotf03d97c952018-07-04 22:08:10183 "//mojo/core/embedder",
mukai6ba73552014-10-09 19:05:17184 "//net",
185 "//net:test_support",
Abhishek Bhardwajd98628e2019-02-27 03:17:21186 "//services/device/public/cpp/test:test_support",
187 "//services/device/public/mojom",
Luum Habtemariamb30c8112018-06-25 21:51:22188 "//services/network:test_support",
Jay Civelli1ba115722018-07-16 17:41:01189 "//services/network/public/cpp",
Abhishek Bhardwajd98628e2019-02-27 03:17:21190 "//services/service_manager/public/cpp/test:test_support",
mukai6ba73552014-10-09 19:05:17191 "//testing/gmock",
192 "//testing/gtest",
jshin77e507b2015-04-24 01:13:15193 "//third_party/icu",
mukai6ba73552014-10-09 19:05:17194 "//url",
mukai6ba73552014-10-09 19:05:17195 ]
teravest54ee2252017-03-17 14:18:16196 sources = [
197 "app_mode/kiosk_oem_manifest_parser_unittest.cc",
A Olsend994a4c2018-10-02 11:35:30198 "policy/weekly_time/time_utils_unittest.cc",
199 "policy/weekly_time/weekly_time_interval_unittest.cc",
200 "policy/weekly_time/weekly_time_unittest.cc",
Luum Habtemariam2cbe8352019-01-25 20:57:52201 "printing/epson_driver_matching_unittest.cc",
teravest54ee2252017-03-17 14:18:16202 "printing/ppd_cache_unittest.cc",
Justin Carlson781f77e212017-11-15 22:32:31203 "printing/ppd_line_reader_unittest.cc",
teravest54ee2252017-03-17 14:18:16204 "printing/ppd_provider_unittest.cc",
Sean Kauff2bbe72018-05-23 01:05:02205 "printing/printer_configuration_unittest.cc",
teravest54ee2252017-03-17 14:18:16206 "printing/printer_translator_unittest.cc",
207 "process_proxy/process_output_watcher_unittest.cc",
208 "process_proxy/process_proxy_unittest.cc",
squea15eba142017-04-25 15:41:36209 "system/cpu_temperature_reader_unittest.cc",
Abhishek Bhardwajd98628e2019-02-27 03:17:21210 "system/dark_resume_controller_unittest.cc",
Pavol Markoac1f5612018-05-19 21:44:59211 "system/factory_ping_embargo_check_unittest.cc",
teravest54ee2252017-03-17 14:18:16212 "system/name_value_pairs_parser_unittest.cc",
Steven Bennettsfc6af1c2019-01-03 18:22:02213 "test/run_all_unittests.cc",
teravest54ee2252017-03-17 14:18:16214 ]
dpranke94c6fb22016-06-10 01:55:08215
216 data = [
217 "test/data/",
dpranke94c6fb22016-06-10 01:55:08218 ]
mukai6ba73552014-10-09 19:05:17219}
220
Ben Pastene70ce32d22018-09-10 22:30:52221# The following definitions only apply when building for a CrOS board (ie: not
222# linux-chromeos). See the following for reference:
223# https://chromium.googlesource.com/chromium/src/+/master/docs/chromeos_build_instructions.md
224# https://chromium.googlesource.com/chromiumos/docs/+/master/simple_chrome_workflow.md
James Cook209256f2018-12-07 18:40:50225if (is_cros_chrome_sdk) {
Ben Pastene4ab98652018-12-17 18:33:18226 generate_runner_script("cros_vm_launcher") {
Ben Pastenec1543c22018-05-04 23:39:43227 generated_script = "$root_build_dir/bin/launch_cros_vm"
Ben Pastene22d25c82018-08-06 20:18:34228
229 # Assume every time we build cros_vm_launcher, we also build chrome and
230 # want to deploy it to the VM.
231 deploy_chrome = true
Ben Pastenec1543c22018-05-04 23:39:43232 }
Ben Pastene9ec70f92018-05-14 21:09:22233
Ben Pastene4ab98652018-12-17 18:33:18234 # The sanity test's actual binary is baked into the OS image. All we need to
Ben Pastene9ec70f92018-05-14 21:09:22235 # do is build the test wrapper and build our own browser to push to the VM
236 # before testing it.
Ben Pastene4ab98652018-12-17 18:33:18237 generate_runner_script("cros_vm_sanity_test") {
Ben Pastene16882032018-09-21 01:16:39238 testonly = true
239 test_exe = "cros_vm_sanity_test"
Ben Pastene9ec70f92018-05-14 21:09:22240 generated_script = "$root_build_dir/bin/run_cros_vm_sanity_test"
Ben Pastened09dd692018-09-21 18:58:10241 runtime_deps_file = "$root_out_dir/cros_vm_sanity_test.runtime_deps"
Ben Pastene9ec70f92018-05-14 21:09:22242
Ben Pastene16882032018-09-21 01:16:39243 data_deps = [
244 ":cros_chrome_deploy",
245 "//:chromiumos_preflight", # Builds the browser.
246 ]
Ben Pastene9ec70f92018-05-14 21:09:22247 }
Ben Pastene2bc796b2018-08-03 03:02:00248
Ben Pastene33015a02018-09-28 18:59:14249 tast_test("chrome_login_tast_tests") {
250 tast_tests = [
251 "ui.ChromeLogin",
252 "ui.ChromeCrashLoggedIn",
253 "ui.ChromeCrashNotLoggedIn",
254 ]
255 }
256
James Cookc3828a42018-11-28 23:33:23257 # Tast test sources live in the Chromium OS repository.
258 # To diagnose tast failures or disable tests, see go/tast-failures
Ben Pastene09de3942018-10-02 18:06:42259 tast_test("chrome_all_tast_tests") {
Mohsen Izadi74514c22019-01-30 17:49:09260 # To disable a specific test, add it the following list.
Ben Pastene8de02e8912019-02-15 18:06:55261 tast_disabled_tests = []
Ben Pasteneacc68d72018-12-20 00:49:10262 }
263 tast_test("chrome_kevin_tast_tests") {
264 # Tests that fail on Kevin devices.
Ben Pastenebd09c422019-01-24 22:08:54265 tast_disabled_tests = [
266 # Disabled due to misleading USE flags on full boards. crbug.com/916367
267 "arc.Boot",
Ben Pastene263c7192019-02-22 19:00:41268 "arc.BuildProperties",
Ben Pastenebd09c422019-01-24 22:08:54269 "security.NetworkListenersARC",
270 "video.WebRTCPeerConnCameraVP8", # crbug.com/923061
271 ]
Ben Pastene09de3942018-10-02 18:06:42272 }
273
Ben Pastene2bc796b2018-08-03 03:02:00274 group("cros_chrome_deploy") {
275 # The following run-time dependencies are needed to deploy chrome to a
276 # ChromeOS device. See the link for the full list:
277 # https://codesearch.chromium.org/chromium/src/third_party/chromite/lib/chrome_util.py?l=341
278 # Most of these are copy targets, for which GN doesn't add their outputs
279 # as runtime-deps. See the link below for more details:
280 # https://chromium.googlesource.com/chromium/src/+/master/tools/gn/docs/reference.md#actions-and-copies
281 data_deps = [
282 "//chrome:xdg_mime",
283 "//mojo/core:shared_library_arc32",
284 "//mojo/core:shared_library_arc64",
285 ]
286
287 # TODO(bpastene): Figure out what's generating resources/chromeos/ and
288 # declare it as a dep instead of adding the dir directly.
289 data = [
290 "$root_out_dir/resources/chromeos/",
291 ]
292 }
Ben Pastenec60bf5022018-05-04 01:10:33293}