[email protected] | 743530f | 2014-06-12 19:38:50 | [diff] [blame] | 1 | # 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 | |
mukai | 6ba7355 | 2014-10-09 19:05:17 | [diff] [blame] | 5 | import("//build/config/ui.gni") |
qsr | fb5251d1 | 2015-01-21 15:57:22 | [diff] [blame] | 6 | import("//testing/test.gni") |
[email protected] | 743530f | 2014-06-12 19:38:50 | [diff] [blame] | 7 | import("//third_party/protobuf/proto_library.gni") |
| 8 | |
mukai | 327e5f5 | 2014-10-16 19:10:52 | [diff] [blame] | 9 | assert(is_chromeos, "Non-ChromeOS builds must not depend on //chromeos") |
| 10 | |
hashimoto | aa1465a | 2015-12-11 06:19:59 | [diff] [blame] | 11 | declare_args() { |
| 12 | # Use binder. Binder related code is compiled only when true. |
| 13 | use_binder = false |
| 14 | } |
| 15 | |
scottmg | 34fb7e5 | 2014-12-03 23:27:24 | [diff] [blame] | 16 | gypi_values = exec_script("//build/gypi_to_gn.py", |
| 17 | [ rebase_path("chromeos.gyp") ], |
| 18 | "scope", |
| 19 | [ "chromeos.gyp" ]) |
mukai | 6ba7355 | 2014-10-09 19:05:17 | [diff] [blame] | 20 | |
| 21 | component("chromeos") { |
svaldez | 2135be5 | 2016-04-20 16:34:53 | [diff] [blame] | 22 | configs += [ "//third_party/nss:system_nss_no_ssl_config" ] |
scottmg | 34fb7e5 | 2014-12-03 23:27:24 | [diff] [blame] | 23 | public_deps = [ |
| 24 | "//dbus", |
mukai | 6ba7355 | 2014-10-09 19:05:17 | [diff] [blame] | 25 | ] |
| 26 | deps = [ |
drcrash | 7da3d8b | 2016-09-09 05:39:53 | [diff] [blame] | 27 | ":attestation_proto", |
agrieve | d7a71c88 | 2015-11-20 19:53:28 | [diff] [blame] | 28 | ":cryptohome_proto", |
| 29 | ":power_manager_proto", |
mukai | 6ba7355 | 2014-10-09 19:05:17 | [diff] [blame] | 30 | "//base", |
Nico Weber | a3d0a42 | 2015-01-20 21:46:21 | [diff] [blame] | 31 | "//base:i18n", |
mukai | 6ba7355 | 2014-10-09 19:05:17 | [diff] [blame] | 32 | "//base/third_party/dynamic_annotations", |
reillyg | 4a84927 | 2015-02-20 21:38:43 | [diff] [blame] | 33 | "//components/device_event_log", |
mukai | 6ba7355 | 2014-10-09 19:05:17 | [diff] [blame] | 34 | "//components/onc", |
agrieve | d7a71c88 | 2015-11-20 19:53:28 | [diff] [blame] | 35 | "//components/policy/proto", |
brettw | 9f7802a2 | 2016-01-30 06:40:17 | [diff] [blame] | 36 | "//components/prefs", |
stevenjb | 8336888 | 2015-07-10 20:51:45 | [diff] [blame] | 37 | "//components/proxy_config", |
alemate | bd6a733 | 2015-10-20 19:35:53 | [diff] [blame] | 38 | "//components/signin/core/account_id", |
alemate | 627f653 | 2016-03-04 10:39:54 | [diff] [blame] | 39 | "//components/user_manager", |
mukai | 6ba7355 | 2014-10-09 19:05:17 | [diff] [blame] | 40 | "//crypto", |
nkostylev | 8d7d18d | 2015-01-28 11:25:08 | [diff] [blame] | 41 | "//crypto:platform", |
mukai | 6ba7355 | 2014-10-09 19:05:17 | [diff] [blame] | 42 | "//google_apis", |
oshima | 3f959fa8 | 2016-05-02 18:42:57 | [diff] [blame] | 43 | "//net", |
mukai | 6ba7355 | 2014-10-09 19:05:17 | [diff] [blame] | 44 | "//third_party/icu", |
| 45 | "//third_party/libxml", |
| 46 | "//third_party/protobuf:protobuf_lite", |
mukai | 6ba7355 | 2014-10-09 19:05:17 | [diff] [blame] | 47 | "//url", |
mukai | 6ba7355 | 2014-10-09 19:05:17 | [diff] [blame] | 48 | ] |
| 49 | sources = gypi_values.chromeos_sources |
| 50 | defines = [ "CHROMEOS_IMPLEMENTATION" ] |
agrieve | c50a654 | 2016-06-09 03:44:09 | [diff] [blame] | 51 | if (current_cpu == "arm" || current_cpu == "x86") { |
hashimoto | c5ffb8b | 2016-03-09 03:19:31 | [diff] [blame] | 52 | defines += [ "BINDER_IPC_32BIT" ] |
hashimoto | aa1465a | 2015-12-11 06:19:59 | [diff] [blame] | 53 | } |
mukai | 6ba7355 | 2014-10-09 19:05:17 | [diff] [blame] | 54 | } |
| 55 | |
skau | 65455b5a0 | 2016-08-03 20:16:38 | [diff] [blame] | 56 | # This must be a static library instead of a source set because some of the |
brettw | c4e6a0f | 2015-08-27 18:28:32 | [diff] [blame] | 57 | # 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 Wilson | 16eb70c | 2015-08-22 21:08:09 | [diff] [blame] | 61 | static_library("test_support") { |
mukai | 6ba7355 | 2014-10-09 19:05:17 | [diff] [blame] | 62 | testonly = true |
agrieve | 95ba444 | 2016-04-25 15:47:13 | [diff] [blame] | 63 | configs += [ "//build/config/linux/dbus" ] |
Brett Wilson | 817fec0 | 2015-08-22 20:36:49 | [diff] [blame] | 64 | public_deps = [ |
drcrash | 7da3d8b | 2016-09-09 05:39:53 | [diff] [blame] | 65 | ":attestation_proto", |
mukai | 6ba7355 | 2014-10-09 19:05:17 | [diff] [blame] | 66 | ":chromeos", |
| 67 | ":cryptohome_proto", |
| 68 | ":power_manager_proto", |
oshima | 3f959fa8 | 2016-05-02 18:42:57 | [diff] [blame] | 69 | ] |
| 70 | deps = [ |
mukai | 6ba7355 | 2014-10-09 19:05:17 | [diff] [blame] | 71 | ":test_support_without_gmock", |
oshima | 3f959fa8 | 2016-05-02 18:42:57 | [diff] [blame] | 72 | "//components/signin/core/account_id", |
| 73 | "//dbus:test_support", |
| 74 | "//google_apis", |
| 75 | "//net:test_support", |
Brett Wilson | 817fec0 | 2015-08-22 20:36:49 | [diff] [blame] | 76 | "//testing/gmock", |
oshima | 3f959fa8 | 2016-05-02 18:42:57 | [diff] [blame] | 77 | "//testing/gtest", |
mukai | 6ba7355 | 2014-10-09 19:05:17 | [diff] [blame] | 78 | ] |
| 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", |
pstew | 9d39208 | 2014-11-05 14:45:20 | [diff] [blame] | 90 | "dbus/mock_lorgnette_manager_client.cc", |
| 91 | "dbus/mock_lorgnette_manager_client.h", |
reillyg | 556a9e9 | 2015-04-07 22:49:58 | [diff] [blame] | 92 | "dbus/mock_permission_broker_client.cc", |
| 93 | "dbus/mock_permission_broker_client.h", |
mukai | 6ba7355 | 2014-10-09 19:05:17 | [diff] [blame] | 94 | "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", |
hashimoto | 1472afe | 2014-11-18 06:18:40 | [diff] [blame] | 102 | "dbus/services/service_provider_test_helper.cc", |
| 103 | "dbus/services/service_provider_test_helper.h", |
mukai | 6ba7355 | 2014-10-09 19:05:17 | [diff] [blame] | 104 | "disks/mock_disk_mount_manager.cc", |
| 105 | "disks/mock_disk_mount_manager.h", |
brettw | 6c1a772 | 2015-01-06 08:34:24 | [diff] [blame] | 106 | "login/auth/fake_extended_authenticator.cc", |
| 107 | "login/auth/fake_extended_authenticator.h", |
mukai | 6ba7355 | 2014-10-09 19:05:17 | [diff] [blame] | 108 | "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", |
mukai | 6ba7355 | 2014-10-09 19:05:17 | [diff] [blame] | 112 | "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", |
malaykeshav | 77a1ea0 | 2016-04-21 18:55:50 | [diff] [blame] | 118 | "network/mock_network_device_handler.cc", |
| 119 | "network/mock_network_device_handler.h", |
mukai | 6ba7355 | 2014-10-09 19:05:17 | [diff] [blame] | 120 | "network/onc/onc_test_utils.cc", |
| 121 | "network/onc/onc_test_utils.h", |
mukai | 6ba7355 | 2014-10-09 19:05:17 | [diff] [blame] | 122 | ] |
| 123 | } |
| 124 | |
| 125 | static_library("test_support_without_gmock") { |
| 126 | testonly = true |
agrieve | 95ba444 | 2016-04-25 15:47:13 | [diff] [blame] | 127 | configs += [ "//build/config/linux/dbus" ] |
mukai | 6ba7355 | 2014-10-09 19:05:17 | [diff] [blame] | 128 | deps = [ |
drcrash | 7da3d8b | 2016-09-09 05:39:53 | [diff] [blame] | 129 | ":attestation_proto", |
mukai | 6ba7355 | 2014-10-09 19:05:17 | [diff] [blame] | 130 | ":chromeos", |
| 131 | ":cryptohome_proto", |
| 132 | ":power_manager_proto", |
agrieve | d7a71c88 | 2015-11-20 19:53:28 | [diff] [blame] | 133 | "//crypto", |
mukai | 6ba7355 | 2014-10-09 19:05:17 | [diff] [blame] | 134 | ] |
| 135 | sources = [ |
| 136 | "dbus/fake_cros_disks_client.cc", |
| 137 | "dbus/fake_cros_disks_client.h", |
mukai | 6ba7355 | 2014-10-09 19:05:17 | [diff] [blame] | 138 | "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", |
mukai | 6ba7355 | 2014-10-09 19:05:17 | [diff] [blame] | 144 | ] |
| 145 | } |
| 146 | |
| 147 | test("chromeos_unittests") { |
| 148 | configs += [ |
agrieve | 95ba444 | 2016-04-25 15:47:13 | [diff] [blame] | 149 | "//build/config/linux/dbus", |
svaldez | 2135be5 | 2016-04-20 16:34:53 | [diff] [blame] | 150 | "//third_party/nss:system_nss_no_ssl_config", |
mukai | 6ba7355 | 2014-10-09 19:05:17 | [diff] [blame] | 151 | ] |
| 152 | deps = [ |
drcrash | 7da3d8b | 2016-09-09 05:39:53 | [diff] [blame] | 153 | ":attestation_proto", |
agrieve | d7a71c88 | 2015-11-20 19:53:28 | [diff] [blame] | 154 | ":cryptohome_proto", |
| 155 | ":power_manager_proto", |
| 156 | ":test_support", |
mukai | 6ba7355 | 2014-10-09 19:05:17 | [diff] [blame] | 157 | "//base/test:run_all_unittests", |
| 158 | "//base/test:test_support", |
| 159 | "//components/onc", |
brettw | 9f7802a2 | 2016-01-30 06:40:17 | [diff] [blame] | 160 | "//components/prefs:test_support", |
stevenjb | 8336888 | 2015-07-10 20:51:45 | [diff] [blame] | 161 | "//components/proxy_config", |
alemate | 627f653 | 2016-03-04 10:39:54 | [diff] [blame] | 162 | "//components/signin/core/account_id", |
mukai | 6ba7355 | 2014-10-09 19:05:17 | [diff] [blame] | 163 | "//crypto", |
| 164 | "//crypto:test_support", |
| 165 | "//dbus:test_support", |
| 166 | "//google_apis", |
| 167 | "//net", |
| 168 | "//net:test_support", |
| 169 | "//testing/gmock", |
| 170 | "//testing/gtest", |
jshin | 77e507b | 2015-04-24 01:13:15 | [diff] [blame] | 171 | "//third_party/icu", |
mukai | 6ba7355 | 2014-10-09 19:05:17 | [diff] [blame] | 172 | "//url", |
mukai | 6ba7355 | 2014-10-09 19:05:17 | [diff] [blame] | 173 | ] |
| 174 | sources = gypi_values.chromeos_test_sources |
hashimoto | aa1465a | 2015-12-11 06:19:59 | [diff] [blame] | 175 | if (use_binder) { |
agrieve | c50a654 | 2016-06-09 03:44:09 | [diff] [blame] | 176 | if (current_cpu == "arm" || current_cpu == "x86") { |
hashimoto | aa1465a | 2015-12-11 06:19:59 | [diff] [blame] | 177 | defines += [ "BINDER_IPC_32BIT" ] |
| 178 | } |
| 179 | sources += gypi_values.chromeos_binder_test_sources |
| 180 | } |
dpranke | 94c6fb2 | 2016-06-10 01:55:08 | [diff] [blame] | 181 | |
| 182 | data = [ |
| 183 | "test/data/", |
dpranke | 94c6fb2 | 2016-06-10 01:55:08 | [diff] [blame] | 184 | ] |
mukai | 6ba7355 | 2014-10-09 19:05:17 | [diff] [blame] | 185 | } |
| 186 | |
[email protected] | 743530f | 2014-06-12 19:38:50 | [diff] [blame] | 187 | proto_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 | ] |
mukai | 6ba7355 | 2014-10-09 19:05:17 | [diff] [blame] | 195 | |
| 196 | proto_out_dir = "chromeos/dbus/power_manager" |
| 197 | } |
| 198 | |
| 199 | proto_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 | |
drcrash | 7da3d8b | 2016-09-09 05:39:53 | [diff] [blame] | 208 | proto_library("attestation_proto") { |
| 209 | sources = [ |
| 210 | "dbus/proto/attestation.proto", |
| 211 | ] |
| 212 | |
| 213 | proto_out_dir = "chromeos/attestation" |
| 214 | } |
| 215 | |
mukai | 6ba7355 | 2014-10-09 19:05:17 | [diff] [blame] | 216 | proto_library("cryptohome_signkey_proto") { |
| 217 | sources = [ |
| 218 | "//third_party/cros_system_api/dbus/cryptohome/signed_secret.proto", |
| 219 | ] |
| 220 | |
mukai | 4e5b67db | 2014-10-10 21:08:23 | [diff] [blame] | 221 | proto_out_dir = "chromeos/cryptohome" |
[email protected] | 743530f | 2014-06-12 19:38:50 | [diff] [blame] | 222 | } |