blob: 1ac6a422169ac30d2726f2b0d58b6b8274c92d0e [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",
Tiancong Wang5abb47752019-07-10 19:18:4727 "//build/config/compiler:use_orderfile_for_hugepage",
A Olsen37962d2e2018-10-12 15:05:1828 ]
scottmg34fb7e52014-12-03 23:27:2429 public_deps = [
Steven Bennetts37852ef2019-03-06 00:32:2330 "//chromeos/constants",
mukai6ba73552014-10-09 19:05:1731 ]
32 deps = [
Steven Bennettscc799d42019-01-11 19:31:4033 ":chromeos_export",
mukai6ba73552014-10-09 19:05:1734 "//base",
Nico Webera3d0a422015-01-20 21:46:2135 "//base:i18n",
Abhishek Bhardwajd98628e2019-02-27 03:17:2136 "//chromeos/dbus",
Steven Bennetts37852ef2019-03-06 00:32:2337 "//chromeos/dbus/constants",
agrieved7a71c882015-11-20 19:53:2838 "//components/policy/proto",
mukai6ba73552014-10-09 19:05:1739 "//google_apis",
Luum Habtemariamb30c8112018-06-25 21:51:2240 "//services/network/public/cpp:cpp",
mukai6ba73552014-10-09 19:05:1741 "//third_party/protobuf:protobuf_lite",
mukai6ba73552014-10-09 19:05:1742 ]
teravest54ee2252017-03-17 14:18:1643 sources = [
teravest54ee2252017-03-17 14:18:1644 "hugepage_text/hugepage_text.cc",
45 "hugepage_text/hugepage_text.h",
A Olsend994a4c2018-10-02 11:35:3046 "policy/weekly_time/time_utils.cc",
47 "policy/weekly_time/time_utils.h",
48 "policy/weekly_time/weekly_time.cc",
49 "policy/weekly_time/weekly_time.h",
50 "policy/weekly_time/weekly_time_interval.cc",
51 "policy/weekly_time/weekly_time_interval.h",
Luum Habtemariam2cbe8352019-01-25 20:57:5252 "printing/epson_driver_matching.cc",
53 "printing/epson_driver_matching.h",
teravest54ee2252017-03-17 14:18:1654 "printing/ppd_cache.cc",
55 "printing/ppd_cache.h",
Justin Carlson781f77e212017-11-15 22:32:3156 "printing/ppd_line_reader.cc",
57 "printing/ppd_line_reader.h",
teravest54ee2252017-03-17 14:18:1658 "printing/ppd_provider.cc",
59 "printing/ppd_provider.h",
60 "printing/printer_configuration.cc",
61 "printing/printer_configuration.h",
62 "printing/printer_translator.cc",
63 "printing/printer_translator.h",
David Valleau03e6fa6b2018-01-19 02:54:2664 "printing/uri_components.cc",
65 "printing/uri_components.h",
Sean Kau4ca71ea32019-07-02 19:33:4666 "printing/usb_printer_id.cc",
67 "printing/usb_printer_id.h",
teravest54ee2252017-03-17 14:18:1668 "process_proxy/process_output_watcher.cc",
69 "process_proxy/process_output_watcher.h",
70 "process_proxy/process_proxy.cc",
71 "process_proxy/process_proxy.h",
72 "process_proxy/process_proxy_registry.cc",
73 "process_proxy/process_proxy_registry.h",
teravest54ee2252017-03-17 14:18:1674 ]
agrievec50a6542016-06-09 03:44:0975 if (current_cpu == "arm" || current_cpu == "x86") {
A Olsen37962d2e2018-10-12 15:05:1876 defines = [ "BINDER_IPC_32BIT" ]
hashimotoaa1465a2015-12-11 06:19:5977 }
mukai6ba73552014-10-09 19:05:1778}
79
A Olsen94579842018-10-10 19:22:3180source_set("chromeos_export") {
81 deps = [
82 "//base",
83 ]
84 sources = [
85 "chromeos_export.h",
86 ]
87}
88
skau65455b5a02016-08-03 20:16:3889# This must be a static library instead of a source set because some of the
brettwc4e6a0f2015-08-27 18:28:3290# files pull in things with dependencies that aren't linked in all cases.
91#
92# TODO this should probably be changed such that it links in all cases and
93# can be converted to a source set.
Brett Wilson16eb70c2015-08-22 21:08:0994static_library("test_support") {
mukai6ba73552014-10-09 19:05:1795 testonly = true
A Olsen94579842018-10-10 19:22:3196 public_deps = [
97 ":test_support_source_set",
98 ]
99}
100
101source_set("test_support_source_set") {
102 testonly = true
Brett Wilson817fec02015-08-22 20:36:49103 public_deps = [
mukai6ba73552014-10-09 19:05:17104 ":chromeos",
Steven Bennetts8e97939f2019-01-11 16:11:31105 ":test_utils",
oshima3f959fa82016-05-02 18:42:57106 ]
107 deps = [
Steven Bennettsc5f108132019-01-09 20:20:34108 "//chromeos/attestation:test_support",
109 "//chromeos/cryptohome:test_support",
Steven Bennetts39046b32019-01-10 17:15:16110 "//chromeos/dbus:test_support",
Steven Bennetts0ac86392019-01-09 19:05:51111 "//chromeos/disks:test_support",
Steven Bennetts2e6eaf72019-01-04 16:52:39112 "//chromeos/login/auth:test_support",
113 "//chromeos/login/login_state:test_support",
Steven Bennetts036b9b62019-01-11 17:47:57114 "//chromeos/network:test_support",
A Olsen6c0bcf32019-03-26 19:35:16115 "//chromeos/tpm:test_support",
oshima3f959fa82016-05-02 18:42:57116 "//google_apis",
117 "//net:test_support",
Luum Habtemariamb30c8112018-06-25 21:51:22118 "//services/network:test_support",
Brett Wilson817fec02015-08-22 20:36:49119 "//testing/gmock",
oshima3f959fa82016-05-02 18:42:57120 "//testing/gtest",
mukai6ba73552014-10-09 19:05:17121 ]
Steven Bennetts8e97939f2019-01-11 16:11:31122}
123
124source_set("test_utils") {
125 deps = [
126 "//base",
127 ]
mukai6ba73552014-10-09 19:05:17128 sources = [
Steven Bennettsfc6af1c2019-01-03 18:22:02129 "test/chromeos_test_utils.cc",
130 "test/chromeos_test_utils.h",
mukai6ba73552014-10-09 19:05:17131 ]
132}
133
mukai6ba73552014-10-09 19:05:17134test("chromeos_unittests") {
135 configs += [
agrieve95ba4442016-04-25 15:47:13136 "//build/config/linux/dbus",
Nico Weber2023256d2018-08-28 17:44:57137 "//build/config/linux/nss:system_nss_no_ssl_config",
mukai6ba73552014-10-09 19:05:17138 ]
139 deps = [
James Cook209256f2018-12-07 18:40:50140 ":chromeos_buildflags",
agrieved7a71c882015-11-20 19:53:28141 ":test_support",
mukai6ba73552014-10-09 19:05:17142 "//base/test:test_support",
Steven Bennettsc5f108132019-01-09 20:20:34143 "//chromeos/attestation:unit_tests",
Steven Bennettsfbcd25f2019-01-09 17:22:09144 "//chromeos/audio:unit_tests",
A Olsen94579842018-10-10 19:22:31145 "//chromeos/cryptohome:unit_tests",
Steven Bennettsa992e432019-01-11 00:21:12146 "//chromeos/dbus:test_support",
A Olsen94579842018-10-10 19:22:31147 "//chromeos/dbus:unit_tests",
Steven Bennetts0b493ad2019-01-07 21:38:39148 "//chromeos/dbus/services:unit_tests",
Steven Bennetts0ac86392019-01-09 19:05:51149 "//chromeos/disks:unit_tests",
Steven Bennettsc2da12d2019-01-10 18:29:47150 "//chromeos/geolocation:unit_tests",
Steven Bennetts4bea3032019-01-03 19:33:18151 "//chromeos/login/auth:unit_tests",
152 "//chromeos/login/login_state:unit_tests",
Igor4005d602019-05-16 15:01:22153 "//chromeos/login/session:unit_tests",
Steven Bennetts8e97939f2019-01-11 16:11:31154 "//chromeos/network:test_support",
A Olsen37962d2e2018-10-12 15:05:18155 "//chromeos/network:unit_tests",
Kyle Horimoto940d7df2018-03-17 01:00:23156 "//chromeos/services:unit_tests",
A Olsen94579842018-10-10 19:22:31157 "//chromeos/settings:unit_tests",
Steven Bennetts1c8956002019-04-16 15:42:47158 "//chromeos/system:unit_tests",
Steven Bennettsc2da12d2019-01-10 18:29:47159 "//chromeos/timezone:unit_tests",
Steven Bennetts94c48062019-01-08 20:12:09160 "//chromeos/tpm:unit_tests",
mukai6ba73552014-10-09 19:05:17161 "//components/onc",
A Olsend994a4c2018-10-02 11:35:30162 "//components/policy:generated",
163 "//components/policy/proto",
brettw9f7802a22016-01-30 06:40:17164 "//components/prefs:test_support",
stevenjb83368882015-07-10 20:51:45165 "//components/proxy_config",
mukai6ba73552014-10-09 19:05:17166 "//dbus:test_support",
167 "//google_apis",
Ken Rockotf03d97c952018-07-04 22:08:10168 "//mojo/core/embedder",
mukai6ba73552014-10-09 19:05:17169 "//net",
170 "//net:test_support",
Luum Habtemariamb30c8112018-06-25 21:51:22171 "//services/network:test_support",
Jay Civelli1ba115722018-07-16 17:41:01172 "//services/network/public/cpp",
mukai6ba73552014-10-09 19:05:17173 "//testing/gmock",
174 "//testing/gtest",
jshin77e507b2015-04-24 01:13:15175 "//third_party/icu",
mukai6ba73552014-10-09 19:05:17176 "//url",
mukai6ba73552014-10-09 19:05:17177 ]
teravest54ee2252017-03-17 14:18:16178 sources = [
A Olsend994a4c2018-10-02 11:35:30179 "policy/weekly_time/time_utils_unittest.cc",
180 "policy/weekly_time/weekly_time_interval_unittest.cc",
181 "policy/weekly_time/weekly_time_unittest.cc",
Luum Habtemariam2cbe8352019-01-25 20:57:52182 "printing/epson_driver_matching_unittest.cc",
teravest54ee2252017-03-17 14:18:16183 "printing/ppd_cache_unittest.cc",
Justin Carlson781f77e212017-11-15 22:32:31184 "printing/ppd_line_reader_unittest.cc",
teravest54ee2252017-03-17 14:18:16185 "printing/ppd_provider_unittest.cc",
Sean Kauff2bbe72018-05-23 01:05:02186 "printing/printer_configuration_unittest.cc",
teravest54ee2252017-03-17 14:18:16187 "printing/printer_translator_unittest.cc",
Sean Kau4ca71ea32019-07-02 19:33:46188 "printing/usb_printer_id_unittest.cc",
teravest54ee2252017-03-17 14:18:16189 "process_proxy/process_output_watcher_unittest.cc",
190 "process_proxy/process_proxy_unittest.cc",
Steven Bennettsfc6af1c2019-01-03 18:22:02191 "test/run_all_unittests.cc",
teravest54ee2252017-03-17 14:18:16192 ]
dpranke94c6fb22016-06-10 01:55:08193
194 data = [
195 "test/data/",
dpranke94c6fb22016-06-10 01:55:08196 ]
mukai6ba73552014-10-09 19:05:17197}
198
Ben Pastene70ce32d22018-09-10 22:30:52199# The following definitions only apply when building for a CrOS board (ie: not
200# linux-chromeos). See the following for reference:
201# https://chromium.googlesource.com/chromium/src/+/master/docs/chromeos_build_instructions.md
202# https://chromium.googlesource.com/chromiumos/docs/+/master/simple_chrome_workflow.md
James Cook209256f2018-12-07 18:40:50203if (is_cros_chrome_sdk) {
Ben Pastene4534c39e2019-07-08 22:55:34204 # This builds a tool that prepares a DUT or VM for testing, which can be
205 # utilized by wrapping a host-side script test.
206 generate_runner_script("cros_test_wrapper") {
207 generated_script = "$root_build_dir/bin/cros_test_wrapper"
Ben Pastene22d25c82018-08-06 20:18:34208
Ben Pastene4534c39e2019-07-08 22:55:34209 # Assume every time we build cros_test_wrapper, we also build chrome and
210 # want to deploy it to the DUT.
Ben Pastene22d25c82018-08-06 20:18:34211 deploy_chrome = true
Ben Pastenec1543c22018-05-04 23:39:43212 }
Ben Pastene9ec70f92018-05-14 21:09:22213
Ben Pastene4ab98652018-12-17 18:33:18214 # The sanity test's actual binary is baked into the OS image. All we need to
Ben Pastene4534c39e2019-07-08 22:55:34215 # do is build the test wrapper and build our own browser to push to the DUT
Ben Pastene9ec70f92018-05-14 21:09:22216 # before testing it.
Ben Pastene4534c39e2019-07-08 22:55:34217 generate_runner_script("cros_browser_sanity_test") {
Ben Pastene16882032018-09-21 01:16:39218 testonly = true
Ben Pastene4534c39e2019-07-08 22:55:34219 test_exe = "cros_browser_sanity_test"
220 generated_script = "$root_build_dir/bin/run_cros_browser_sanity_test"
221 runtime_deps_file = "$root_out_dir/cros_browser_sanity_test.runtime_deps"
Ben Pastene9ec70f92018-05-14 21:09:22222
Ben Pastene16882032018-09-21 01:16:39223 data_deps = [
224 ":cros_chrome_deploy",
225 "//:chromiumos_preflight", # Builds the browser.
226 ]
Ben Pastene9ec70f92018-05-14 21:09:22227 }
Ben Pastene2bc796b2018-08-03 03:02:00228
Ben Pastene33015a02018-09-28 18:59:14229 tast_test("chrome_login_tast_tests") {
230 tast_tests = [
231 "ui.ChromeLogin",
232 "ui.ChromeCrashLoggedIn",
233 "ui.ChromeCrashNotLoggedIn",
234 ]
235 }
236
James Cookc3828a42018-11-28 23:33:23237 # Tast test sources live in the Chromium OS repository.
238 # To diagnose tast failures or disable tests, see go/tast-failures
Ben Pastene09de3942018-10-02 18:06:42239 tast_test("chrome_all_tast_tests") {
Mohsen Izadi74514c22019-01-30 17:49:09240 # To disable a specific test, add it the following list.
Scott Violet67f6fa82019-05-06 16:52:20241 tast_disabled_tests = [
242 "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}