blob: 3e36a2222e0c78c5f09dcf9e38cd724069a7c565 [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",
Luum Habtemariamb30c8112018-06-25 21:51:2239 "//services/network/public/cpp:cpp",
mukai6ba73552014-10-09 19:05:1740 "//third_party/protobuf:protobuf_lite",
mukai6ba73552014-10-09 19:05:1741 ]
teravest54ee2252017-03-17 14:18:1642 sources = [
teravest54ee2252017-03-17 14:18:1643 "hugepage_text/hugepage_text.cc",
44 "hugepage_text/hugepage_text.h",
A Olsend994a4c2018-10-02 11:35:3045 "policy/weekly_time/time_utils.cc",
46 "policy/weekly_time/time_utils.h",
47 "policy/weekly_time/weekly_time.cc",
48 "policy/weekly_time/weekly_time.h",
49 "policy/weekly_time/weekly_time_interval.cc",
50 "policy/weekly_time/weekly_time_interval.h",
Luum Habtemariam2cbe8352019-01-25 20:57:5251 "printing/epson_driver_matching.cc",
52 "printing/epson_driver_matching.h",
teravest54ee2252017-03-17 14:18:1653 "printing/ppd_cache.cc",
54 "printing/ppd_cache.h",
Justin Carlson781f77e212017-11-15 22:32:3155 "printing/ppd_line_reader.cc",
56 "printing/ppd_line_reader.h",
teravest54ee2252017-03-17 14:18:1657 "printing/ppd_provider.cc",
58 "printing/ppd_provider.h",
59 "printing/printer_configuration.cc",
60 "printing/printer_configuration.h",
61 "printing/printer_translator.cc",
62 "printing/printer_translator.h",
David Valleau03e6fa6b2018-01-19 02:54:2663 "printing/uri_components.cc",
64 "printing/uri_components.h",
Sean Kau4ca71ea32019-07-02 19:33:4665 "printing/usb_printer_id.cc",
66 "printing/usb_printer_id.h",
teravest54ee2252017-03-17 14:18:1667 "process_proxy/process_output_watcher.cc",
68 "process_proxy/process_output_watcher.h",
69 "process_proxy/process_proxy.cc",
70 "process_proxy/process_proxy.h",
71 "process_proxy/process_proxy_registry.cc",
72 "process_proxy/process_proxy_registry.h",
teravest54ee2252017-03-17 14:18:1673 ]
agrievec50a6542016-06-09 03:44:0974 if (current_cpu == "arm" || current_cpu == "x86") {
A Olsen37962d2e2018-10-12 15:05:1875 defines = [ "BINDER_IPC_32BIT" ]
hashimotoaa1465a2015-12-11 06:19:5976 }
mukai6ba73552014-10-09 19:05:1777}
78
A Olsen94579842018-10-10 19:22:3179source_set("chromeos_export") {
80 deps = [
81 "//base",
82 ]
83 sources = [
84 "chromeos_export.h",
85 ]
86}
87
skau65455b5a02016-08-03 20:16:3888# This must be a static library instead of a source set because some of the
brettwc4e6a0f2015-08-27 18:28:3289# files pull in things with dependencies that aren't linked in all cases.
90#
91# TODO this should probably be changed such that it links in all cases and
92# can be converted to a source set.
Brett Wilson16eb70c2015-08-22 21:08:0993static_library("test_support") {
mukai6ba73552014-10-09 19:05:1794 testonly = true
A Olsen94579842018-10-10 19:22:3195 public_deps = [
96 ":test_support_source_set",
97 ]
98}
99
100source_set("test_support_source_set") {
101 testonly = true
Brett Wilson817fec02015-08-22 20:36:49102 public_deps = [
mukai6ba73552014-10-09 19:05:17103 ":chromeos",
Steven Bennetts8e97939f2019-01-11 16:11:31104 ":test_utils",
oshima3f959fa82016-05-02 18:42:57105 ]
106 deps = [
Steven Bennettsc5f108132019-01-09 20:20:34107 "//chromeos/attestation:test_support",
108 "//chromeos/cryptohome:test_support",
Steven Bennetts39046b32019-01-10 17:15:16109 "//chromeos/dbus:test_support",
Steven Bennetts0ac86392019-01-09 19:05:51110 "//chromeos/disks:test_support",
Steven Bennetts2e6eaf72019-01-04 16:52:39111 "//chromeos/login/auth:test_support",
112 "//chromeos/login/login_state:test_support",
Steven Bennetts036b9b62019-01-11 17:47:57113 "//chromeos/network:test_support",
A Olsen6c0bcf32019-03-26 19:35:16114 "//chromeos/tpm:test_support",
oshima3f959fa82016-05-02 18:42:57115 "//google_apis",
116 "//net:test_support",
Luum Habtemariamb30c8112018-06-25 21:51:22117 "//services/network:test_support",
Brett Wilson817fec02015-08-22 20:36:49118 "//testing/gmock",
oshima3f959fa82016-05-02 18:42:57119 "//testing/gtest",
mukai6ba73552014-10-09 19:05:17120 ]
Steven Bennetts8e97939f2019-01-11 16:11:31121}
122
123source_set("test_utils") {
124 deps = [
125 "//base",
126 ]
mukai6ba73552014-10-09 19:05:17127 sources = [
Steven Bennettsfc6af1c2019-01-03 18:22:02128 "test/chromeos_test_utils.cc",
129 "test/chromeos_test_utils.h",
mukai6ba73552014-10-09 19:05:17130 ]
131}
132
mukai6ba73552014-10-09 19:05:17133test("chromeos_unittests") {
134 configs += [
agrieve95ba4442016-04-25 15:47:13135 "//build/config/linux/dbus",
Nico Weber2023256d2018-08-28 17:44:57136 "//build/config/linux/nss:system_nss_no_ssl_config",
mukai6ba73552014-10-09 19:05:17137 ]
138 deps = [
James Cook209256f2018-12-07 18:40:50139 ":chromeos_buildflags",
agrieved7a71c882015-11-20 19:53:28140 ":test_support",
mukai6ba73552014-10-09 19:05:17141 "//base/test:test_support",
Steven Bennettsc5f108132019-01-09 20:20:34142 "//chromeos/attestation:unit_tests",
Steven Bennettsfbcd25f2019-01-09 17:22:09143 "//chromeos/audio:unit_tests",
A Olsen94579842018-10-10 19:22:31144 "//chromeos/cryptohome:unit_tests",
Steven Bennettsa992e432019-01-11 00:21:12145 "//chromeos/dbus:test_support",
A Olsen94579842018-10-10 19:22:31146 "//chromeos/dbus:unit_tests",
Steven Bennetts0b493ad2019-01-07 21:38:39147 "//chromeos/dbus/services:unit_tests",
Steven Bennetts0ac86392019-01-09 19:05:51148 "//chromeos/disks:unit_tests",
Steven Bennettsc2da12d2019-01-10 18:29:47149 "//chromeos/geolocation:unit_tests",
Steven Bennetts4bea3032019-01-03 19:33:18150 "//chromeos/login/auth:unit_tests",
151 "//chromeos/login/login_state:unit_tests",
Igor4005d602019-05-16 15:01:22152 "//chromeos/login/session:unit_tests",
Steven Bennetts8e97939f2019-01-11 16:11:31153 "//chromeos/network:test_support",
A Olsen37962d2e2018-10-12 15:05:18154 "//chromeos/network:unit_tests",
Kyle Horimoto940d7df2018-03-17 01:00:23155 "//chromeos/services:unit_tests",
A Olsen94579842018-10-10 19:22:31156 "//chromeos/settings:unit_tests",
Steven Bennetts1c8956002019-04-16 15:42:47157 "//chromeos/system:unit_tests",
Steven Bennettsc2da12d2019-01-10 18:29:47158 "//chromeos/timezone:unit_tests",
Steven Bennetts94c48062019-01-08 20:12:09159 "//chromeos/tpm:unit_tests",
mukai6ba73552014-10-09 19:05:17160 "//components/onc",
A Olsend994a4c2018-10-02 11:35:30161 "//components/policy:generated",
162 "//components/policy/proto",
brettw9f7802a22016-01-30 06:40:17163 "//components/prefs:test_support",
stevenjb83368882015-07-10 20:51:45164 "//components/proxy_config",
mukai6ba73552014-10-09 19:05:17165 "//dbus:test_support",
166 "//google_apis",
Ken Rockotf03d97c952018-07-04 22:08:10167 "//mojo/core/embedder",
mukai6ba73552014-10-09 19:05:17168 "//net",
169 "//net:test_support",
Luum Habtemariamb30c8112018-06-25 21:51:22170 "//services/network:test_support",
Jay Civelli1ba115722018-07-16 17:41:01171 "//services/network/public/cpp",
mukai6ba73552014-10-09 19:05:17172 "//testing/gmock",
173 "//testing/gtest",
jshin77e507b2015-04-24 01:13:15174 "//third_party/icu",
mukai6ba73552014-10-09 19:05:17175 "//url",
mukai6ba73552014-10-09 19:05:17176 ]
teravest54ee2252017-03-17 14:18:16177 sources = [
A Olsend994a4c2018-10-02 11:35:30178 "policy/weekly_time/time_utils_unittest.cc",
179 "policy/weekly_time/weekly_time_interval_unittest.cc",
180 "policy/weekly_time/weekly_time_unittest.cc",
Luum Habtemariam2cbe8352019-01-25 20:57:52181 "printing/epson_driver_matching_unittest.cc",
teravest54ee2252017-03-17 14:18:16182 "printing/ppd_cache_unittest.cc",
Justin Carlson781f77e212017-11-15 22:32:31183 "printing/ppd_line_reader_unittest.cc",
teravest54ee2252017-03-17 14:18:16184 "printing/ppd_provider_unittest.cc",
Sean Kauff2bbe72018-05-23 01:05:02185 "printing/printer_configuration_unittest.cc",
teravest54ee2252017-03-17 14:18:16186 "printing/printer_translator_unittest.cc",
Sean Kau4ca71ea32019-07-02 19:33:46187 "printing/usb_printer_id_unittest.cc",
teravest54ee2252017-03-17 14:18:16188 "process_proxy/process_output_watcher_unittest.cc",
189 "process_proxy/process_proxy_unittest.cc",
Steven Bennettsfc6af1c2019-01-03 18:22:02190 "test/run_all_unittests.cc",
teravest54ee2252017-03-17 14:18:16191 ]
dpranke94c6fb22016-06-10 01:55:08192
193 data = [
194 "test/data/",
dpranke94c6fb22016-06-10 01:55:08195 ]
mukai6ba73552014-10-09 19:05:17196}
197
Ben Pastene70ce32d22018-09-10 22:30:52198# The following definitions only apply when building for a CrOS board (ie: not
199# linux-chromeos). See the following for reference:
200# https://chromium.googlesource.com/chromium/src/+/master/docs/chromeos_build_instructions.md
201# https://chromium.googlesource.com/chromiumos/docs/+/master/simple_chrome_workflow.md
James Cook209256f2018-12-07 18:40:50202if (is_cros_chrome_sdk) {
Ben Pastene4534c39e2019-07-08 22:55:34203 # This builds a tool that prepares a DUT or VM for testing, which can be
204 # utilized by wrapping a host-side script test.
205 generate_runner_script("cros_test_wrapper") {
206 generated_script = "$root_build_dir/bin/cros_test_wrapper"
Ben Pastene22d25c82018-08-06 20:18:34207
Ben Pastene4534c39e2019-07-08 22:55:34208 # Assume every time we build cros_test_wrapper, we also build chrome and
209 # want to deploy it to the DUT.
Ben Pastene22d25c82018-08-06 20:18:34210 deploy_chrome = true
Ben Pastenec1543c22018-05-04 23:39:43211 }
Ben Pastene9ec70f92018-05-14 21:09:22212
Ben Pastene4ab98652018-12-17 18:33:18213 # The sanity test's actual binary is baked into the OS image. All we need to
Ben Pastene4534c39e2019-07-08 22:55:34214 # do is build the test wrapper and build our own browser to push to the DUT
Ben Pastene9ec70f92018-05-14 21:09:22215 # before testing it.
Ben Pastene4534c39e2019-07-08 22:55:34216 generate_runner_script("cros_browser_sanity_test") {
Ben Pastene16882032018-09-21 01:16:39217 testonly = true
Ben Pastene4534c39e2019-07-08 22:55:34218 test_exe = "cros_browser_sanity_test"
219 generated_script = "$root_build_dir/bin/run_cros_browser_sanity_test"
220 runtime_deps_file = "$root_out_dir/cros_browser_sanity_test.runtime_deps"
Ben Pastene9ec70f92018-05-14 21:09:22221
Ben Pastene16882032018-09-21 01:16:39222 data_deps = [
223 ":cros_chrome_deploy",
224 "//:chromiumos_preflight", # Builds the browser.
225 ]
Ben Pastene9ec70f92018-05-14 21:09:22226 }
Ben Pastene2bc796b2018-08-03 03:02:00227
Ben Pastene33015a02018-09-28 18:59:14228 tast_test("chrome_login_tast_tests") {
229 tast_tests = [
230 "ui.ChromeLogin",
231 "ui.ChromeCrashLoggedIn",
232 "ui.ChromeCrashNotLoggedIn",
233 ]
234 }
235
James Cookc3828a42018-11-28 23:33:23236 # Tast test sources live in the Chromium OS repository.
237 # To diagnose tast failures or disable tests, see go/tast-failures
Ben Pastene09de3942018-10-02 18:06:42238 tast_test("chrome_all_tast_tests") {
Mohsen Izadi74514c22019-01-30 17:49:09239 # To disable a specific test, add it the following list.
Scott Violet67f6fa82019-05-06 16:52:20240 tast_disabled_tests = [
Ben Pastene381227f2019-05-29 17:28:27241 "security.SELinuxFilesARC", # crbug.com/968155
Scott Violet67f6fa82019-05-06 16:52:20242 "ui.MashLogin",
243 "ui.SingleProcessMashLogin",
244 ]
Ben Pasteneacc68d72018-12-20 00:49:10245 }
Ben Pastene09de3942018-10-02 18:06:42246
Ben Pastene2bc796b2018-08-03 03:02:00247 group("cros_chrome_deploy") {
248 # The following run-time dependencies are needed to deploy chrome to a
249 # ChromeOS device. See the link for the full list:
250 # https://codesearch.chromium.org/chromium/src/third_party/chromite/lib/chrome_util.py?l=341
251 # Most of these are copy targets, for which GN doesn't add their outputs
252 # as runtime-deps. See the link below for more details:
253 # https://chromium.googlesource.com/chromium/src/+/master/tools/gn/docs/reference.md#actions-and-copies
254 data_deps = [
255 "//chrome:xdg_mime",
256 "//mojo/core:shared_library_arc32",
257 "//mojo/core:shared_library_arc64",
258 ]
259
260 # TODO(bpastene): Figure out what's generating resources/chromeos/ and
261 # declare it as a dep instead of adding the dir directly.
262 data = [
263 "$root_out_dir/resources/chromeos/",
264 ]
265 }
Ben Pastenec60bf5022018-05-04 01:10:33266}