blob: 95dd7f08c0b5ef260da1510712c59a036ca4d73f [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
mukai6ba73552014-10-09 19:05:175import("//build/config/ui.gni")
qsrfb5251d12015-01-21 15:57:226import("//testing/test.gni")
[email protected]743530f2014-06-12 19:38:507import("//third_party/protobuf/proto_library.gni")
8
mukai327e5f52014-10-16 19:10:529assert(is_chromeos, "Non-ChromeOS builds must not depend on //chromeos")
10
hashimotoaa1465a2015-12-11 06:19:5911declare_args() {
12 # Use binder. Binder related code is compiled only when true.
13 use_binder = false
14}
15
scottmg34fb7e52014-12-03 23:27:2416gypi_values = exec_script("//build/gypi_to_gn.py",
17 [ rebase_path("chromeos.gyp") ],
18 "scope",
19 [ "chromeos.gyp" ])
mukai6ba73552014-10-09 19:05:1720
21component("chromeos") {
svaldez2135be52016-04-20 16:34:5322 configs += [ "//third_party/nss:system_nss_no_ssl_config" ]
scottmg34fb7e52014-12-03 23:27:2423 public_deps = [
24 "//dbus",
mukai6ba73552014-10-09 19:05:1725 ]
26 deps = [
drcrash7da3d8b2016-09-09 05:39:5327 ":attestation_proto",
agrieved7a71c882015-11-20 19:53:2828 ":cryptohome_proto",
29 ":power_manager_proto",
mukai6ba73552014-10-09 19:05:1730 "//base",
Nico Webera3d0a422015-01-20 21:46:2131 "//base:i18n",
mukai6ba73552014-10-09 19:05:1732 "//base/third_party/dynamic_annotations",
reillyg4a849272015-02-20 21:38:4333 "//components/device_event_log",
mukai6ba73552014-10-09 19:05:1734 "//components/onc",
agrieved7a71c882015-11-20 19:53:2835 "//components/policy/proto",
brettw9f7802a22016-01-30 06:40:1736 "//components/prefs",
stevenjb83368882015-07-10 20:51:4537 "//components/proxy_config",
alematebd6a7332015-10-20 19:35:5338 "//components/signin/core/account_id",
alemate627f6532016-03-04 10:39:5439 "//components/user_manager",
mukai6ba73552014-10-09 19:05:1740 "//crypto",
nkostylev8d7d18d2015-01-28 11:25:0841 "//crypto:platform",
mukai6ba73552014-10-09 19:05:1742 "//google_apis",
oshima3f959fa82016-05-02 18:42:5743 "//net",
mukai6ba73552014-10-09 19:05:1744 "//third_party/icu",
45 "//third_party/libxml",
46 "//third_party/protobuf:protobuf_lite",
mukai6ba73552014-10-09 19:05:1747 "//url",
mukai6ba73552014-10-09 19:05:1748 ]
49 sources = gypi_values.chromeos_sources
50 defines = [ "CHROMEOS_IMPLEMENTATION" ]
agrievec50a6542016-06-09 03:44:0951 if (current_cpu == "arm" || current_cpu == "x86") {
hashimotoc5ffb8b2016-03-09 03:19:3152 defines += [ "BINDER_IPC_32BIT" ]
hashimotoaa1465a2015-12-11 06:19:5953 }
mukai6ba73552014-10-09 19:05:1754}
55
skau65455b5a02016-08-03 20:16:3856# This must be a static library instead of a source set because some of the
brettwc4e6a0f2015-08-27 18:28:3257# files pull in things with dependencies that aren't linked in all cases.
58#
59# TODO this should probably be changed such that it links in all cases and
60# can be converted to a source set.
Brett Wilson16eb70c2015-08-22 21:08:0961static_library("test_support") {
mukai6ba73552014-10-09 19:05:1762 testonly = true
agrieve95ba4442016-04-25 15:47:1363 configs += [ "//build/config/linux/dbus" ]
Brett Wilson817fec02015-08-22 20:36:4964 public_deps = [
drcrash7da3d8b2016-09-09 05:39:5365 ":attestation_proto",
mukai6ba73552014-10-09 19:05:1766 ":chromeos",
67 ":cryptohome_proto",
68 ":power_manager_proto",
oshima3f959fa82016-05-02 18:42:5769 ]
70 deps = [
mukai6ba73552014-10-09 19:05:1771 ":test_support_without_gmock",
oshima3f959fa82016-05-02 18:42:5772 "//components/signin/core/account_id",
73 "//dbus:test_support",
74 "//google_apis",
75 "//net:test_support",
Brett Wilson817fec02015-08-22 20:36:4976 "//testing/gmock",
oshima3f959fa82016-05-02 18:42:5777 "//testing/gtest",
mukai6ba73552014-10-09 19:05:1778 ]
79 sources = [
80 "attestation/mock_attestation_flow.cc",
81 "attestation/mock_attestation_flow.h",
82 "chromeos_test_utils.cc",
83 "chromeos_test_utils.h",
84 "cryptohome/mock_async_method_caller.cc",
85 "cryptohome/mock_async_method_caller.h",
86 "cryptohome/mock_homedir_methods.cc",
87 "cryptohome/mock_homedir_methods.h",
88 "dbus/mock_cryptohome_client.cc",
89 "dbus/mock_cryptohome_client.h",
pstew9d392082014-11-05 14:45:2090 "dbus/mock_lorgnette_manager_client.cc",
91 "dbus/mock_lorgnette_manager_client.h",
reillyg556a9e92015-04-07 22:49:5892 "dbus/mock_permission_broker_client.cc",
93 "dbus/mock_permission_broker_client.h",
mukai6ba73552014-10-09 19:05:1794 "dbus/mock_session_manager_client.cc",
95 "dbus/mock_session_manager_client.h",
96 "dbus/mock_shill_manager_client.cc",
97 "dbus/mock_shill_manager_client.h",
98 "dbus/mock_shill_profile_client.cc",
99 "dbus/mock_shill_profile_client.h",
100 "dbus/mock_shill_service_client.cc",
101 "dbus/mock_shill_service_client.h",
hashimoto1472afe2014-11-18 06:18:40102 "dbus/services/service_provider_test_helper.cc",
103 "dbus/services/service_provider_test_helper.h",
mukai6ba73552014-10-09 19:05:17104 "disks/mock_disk_mount_manager.cc",
105 "disks/mock_disk_mount_manager.h",
brettw6c1a7722015-01-06 08:34:24106 "login/auth/fake_extended_authenticator.cc",
107 "login/auth/fake_extended_authenticator.h",
mukai6ba73552014-10-09 19:05:17108 "login/auth/mock_auth_attempt_state_resolver.cc",
109 "login/auth/mock_auth_attempt_state_resolver.h",
110 "login/auth/mock_auth_status_consumer.cc",
111 "login/auth/mock_auth_status_consumer.h",
mukai6ba73552014-10-09 19:05:17112 "login/auth/mock_url_fetchers.cc",
113 "login/auth/mock_url_fetchers.h",
114 "network/fake_network_device_handler.cc",
115 "network/fake_network_device_handler.h",
116 "network/mock_managed_network_configuration_handler.cc",
117 "network/mock_managed_network_configuration_handler.h",
malaykeshav77a1ea02016-04-21 18:55:50118 "network/mock_network_device_handler.cc",
119 "network/mock_network_device_handler.h",
mukai6ba73552014-10-09 19:05:17120 "network/onc/onc_test_utils.cc",
121 "network/onc/onc_test_utils.h",
mukai6ba73552014-10-09 19:05:17122 ]
123}
124
125static_library("test_support_without_gmock") {
126 testonly = true
agrieve95ba4442016-04-25 15:47:13127 configs += [ "//build/config/linux/dbus" ]
mukai6ba73552014-10-09 19:05:17128 deps = [
drcrash7da3d8b2016-09-09 05:39:53129 ":attestation_proto",
mukai6ba73552014-10-09 19:05:17130 ":chromeos",
131 ":cryptohome_proto",
132 ":power_manager_proto",
agrieved7a71c882015-11-20 19:53:28133 "//crypto",
mukai6ba73552014-10-09 19:05:17134 ]
135 sources = [
136 "dbus/fake_cros_disks_client.cc",
137 "dbus/fake_cros_disks_client.h",
mukai6ba73552014-10-09 19:05:17138 "dbus/fake_session_manager_client.cc",
139 "dbus/fake_session_manager_client.h",
140 "dbus/fake_shill_manager_client.cc",
141 "dbus/fake_shill_manager_client.h",
142 "dbus/fake_update_engine_client.cc",
143 "dbus/fake_update_engine_client.h",
mukai6ba73552014-10-09 19:05:17144 ]
145}
146
147test("chromeos_unittests") {
148 configs += [
agrieve95ba4442016-04-25 15:47:13149 "//build/config/linux/dbus",
svaldez2135be52016-04-20 16:34:53150 "//third_party/nss:system_nss_no_ssl_config",
mukai6ba73552014-10-09 19:05:17151 ]
152 deps = [
drcrash7da3d8b2016-09-09 05:39:53153 ":attestation_proto",
agrieved7a71c882015-11-20 19:53:28154 ":cryptohome_proto",
155 ":power_manager_proto",
156 ":test_support",
mukai6ba73552014-10-09 19:05:17157 "//base/test:run_all_unittests",
158 "//base/test:test_support",
159 "//components/onc",
brettw9f7802a22016-01-30 06:40:17160 "//components/prefs:test_support",
stevenjb83368882015-07-10 20:51:45161 "//components/proxy_config",
alemate627f6532016-03-04 10:39:54162 "//components/signin/core/account_id",
mukai6ba73552014-10-09 19:05:17163 "//crypto",
164 "//crypto:test_support",
165 "//dbus:test_support",
166 "//google_apis",
167 "//net",
168 "//net:test_support",
169 "//testing/gmock",
170 "//testing/gtest",
jshin77e507b2015-04-24 01:13:15171 "//third_party/icu",
mukai6ba73552014-10-09 19:05:17172 "//url",
mukai6ba73552014-10-09 19:05:17173 ]
174 sources = gypi_values.chromeos_test_sources
hashimotoaa1465a2015-12-11 06:19:59175 if (use_binder) {
agrievec50a6542016-06-09 03:44:09176 if (current_cpu == "arm" || current_cpu == "x86") {
hashimotoaa1465a2015-12-11 06:19:59177 defines += [ "BINDER_IPC_32BIT" ]
178 }
179 sources += gypi_values.chromeos_binder_test_sources
180 }
dpranke94c6fb22016-06-10 01:55:08181
182 data = [
183 "test/data/",
dpranke94c6fb22016-06-10 01:55:08184 ]
mukai6ba73552014-10-09 19:05:17185}
186
[email protected]743530f2014-06-12 19:38:50187proto_library("power_manager_proto") {
188 sources = [
189 "//third_party/cros_system_api/dbus/power_manager/input_event.proto",
190 "//third_party/cros_system_api/dbus/power_manager/peripheral_battery_status.proto",
191 "//third_party/cros_system_api/dbus/power_manager/policy.proto",
192 "//third_party/cros_system_api/dbus/power_manager/power_supply_properties.proto",
193 "//third_party/cros_system_api/dbus/power_manager/suspend.proto",
194 ]
mukai6ba73552014-10-09 19:05:17195
196 proto_out_dir = "chromeos/dbus/power_manager"
197}
198
199proto_library("cryptohome_proto") {
200 sources = [
201 "//third_party/cros_system_api/dbus/cryptohome/key.proto",
202 "//third_party/cros_system_api/dbus/cryptohome/rpc.proto",
203 ]
204
205 proto_out_dir = "chromeos/dbus/cryptohome"
206}
207
drcrash7da3d8b2016-09-09 05:39:53208proto_library("attestation_proto") {
209 sources = [
210 "dbus/proto/attestation.proto",
211 ]
212
213 proto_out_dir = "chromeos/attestation"
214}
215
mukai6ba73552014-10-09 19:05:17216proto_library("cryptohome_signkey_proto") {
217 sources = [
218 "//third_party/cros_system_api/dbus/cryptohome/signed_secret.proto",
219 ]
220
mukai4e5b67db2014-10-10 21:08:23221 proto_out_dir = "chromeos/cryptohome"
[email protected]743530f2014-06-12 19:38:50222}