Infobar MD refresh: close button.
[chromium-blink-merge.git] / chromeos / BUILD.gn
blobb1a13ef5d25136bdfd75ef8c3097022628ed8895
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.
5 import("//build/config/allocator.gni")
6 import("//build/config/ui.gni")
7 import("//testing/test.gni")
8 import("//third_party/protobuf/proto_library.gni")
10 assert(is_chromeos, "Non-ChromeOS builds must not depend on //chromeos")
12 gypi_values = exec_script("//build/gypi_to_gn.py",
13                           [ rebase_path("chromeos.gyp") ],
14                           "scope",
15                           [ "chromeos.gyp" ])
17 component("chromeos") {
18   configs += [ "//net/third_party/nss/ssl:ssl_config" ]
19   public_deps = [
20     "//dbus",
21   ]
22   deps = [
23     "//base",
24     "//base:i18n",
25     "//base:prefs",
26     "//base/third_party/dynamic_annotations",
27     "//chromeos/ime:gencode",
28     "//components/device_event_log",
29     "//components/policy/proto",
30     "//components/onc",
31     "//components/proxy_config",
32     "//crypto",
33     "//crypto:platform",
34     "//google_apis",
35     "//third_party/icu",
36     "//third_party/libxml",
37     "//third_party/protobuf:protobuf_lite",
38     "//url",
39     ":cryptohome_proto",
40     ":power_manager_proto",
41   ]
42   sources = gypi_values.chromeos_sources
43   defines = [ "CHROMEOS_IMPLEMENTATION" ]
46 # TYhis must be a static library instead of a source set because some of the
47 # files pull in things with dependencies that aren't linked in all cases.
49 # TODO this should probably be changed such that it links in all cases and
50 # can be converted to a source set.
51 static_library("test_support") {
52   testonly = true
53   configs += [ "//build/config/linux:dbus" ]
54   public_deps = [
55     ":chromeos",
56     ":cryptohome_proto",
57     ":power_manager_proto",
58     ":test_support_without_gmock",
59     "//testing/gmock",
60   ]
61   sources = [
62     "attestation/mock_attestation_flow.cc",
63     "attestation/mock_attestation_flow.h",
64     "chromeos_test_utils.cc",
65     "chromeos_test_utils.h",
66     "cryptohome/mock_async_method_caller.cc",
67     "cryptohome/mock_async_method_caller.h",
68     "cryptohome/mock_homedir_methods.cc",
69     "cryptohome/mock_homedir_methods.h",
70     "dbus/mock_cryptohome_client.cc",
71     "dbus/mock_cryptohome_client.h",
72     "dbus/mock_lorgnette_manager_client.cc",
73     "dbus/mock_lorgnette_manager_client.h",
74     "dbus/mock_permission_broker_client.cc",
75     "dbus/mock_permission_broker_client.h",
76     "dbus/mock_session_manager_client.cc",
77     "dbus/mock_session_manager_client.h",
78     "dbus/mock_shill_manager_client.cc",
79     "dbus/mock_shill_manager_client.h",
80     "dbus/mock_shill_profile_client.cc",
81     "dbus/mock_shill_profile_client.h",
82     "dbus/mock_shill_service_client.cc",
83     "dbus/mock_shill_service_client.h",
84     "dbus/services/service_provider_test_helper.cc",
85     "dbus/services/service_provider_test_helper.h",
86     "disks/mock_disk_mount_manager.cc",
87     "disks/mock_disk_mount_manager.h",
88     "login/auth/fake_extended_authenticator.cc",
89     "login/auth/fake_extended_authenticator.h",
90     "login/auth/mock_auth_attempt_state_resolver.cc",
91     "login/auth/mock_auth_attempt_state_resolver.h",
92     "login/auth/mock_auth_status_consumer.cc",
93     "login/auth/mock_auth_status_consumer.h",
94     "login/auth/mock_url_fetchers.cc",
95     "login/auth/mock_url_fetchers.h",
96     "network/fake_network_device_handler.cc",
97     "network/fake_network_device_handler.h",
98     "network/mock_managed_network_configuration_handler.cc",
99     "network/mock_managed_network_configuration_handler.h",
100     "network/onc/onc_test_utils.cc",
101     "network/onc/onc_test_utils.h",
102     "system/fake_statistics_provider.cc",
103     "system/fake_statistics_provider.h",
104   ]
107 static_library("test_support_without_gmock") {
108   testonly = true
109   configs += [ "//build/config/linux:dbus" ]
110   deps = [
111     "//crypto",
112     ":chromeos",
113     ":cryptohome_proto",
114     ":power_manager_proto",
115   ]
116   sources = [
117     "dbus/fake_cros_disks_client.cc",
118     "dbus/fake_cros_disks_client.h",
119     "dbus/fake_session_manager_client.cc",
120     "dbus/fake_session_manager_client.h",
121     "dbus/fake_shill_manager_client.cc",
122     "dbus/fake_shill_manager_client.h",
123     "dbus/fake_update_engine_client.cc",
124     "dbus/fake_update_engine_client.h",
125   ]
128 test("chromeos_unittests") {
129   configs += [
130     "//build/config/linux:dbus",
131     "//net/third_party/nss/ssl:ssl_config",
132   ]
133   deps = [
134     "//base:prefs_test_support",
135     "//base/test:run_all_unittests",
136     "//base/test:test_support",
137     "//components/onc",
138     "//components/proxy_config",
139     "//crypto",
140     "//crypto:test_support",
141     "//dbus:test_support",
142     "//google_apis",
143     "//net",
144     "//net:test_support",
145     "//testing/gmock",
146     "//testing/gtest",
147     "//third_party/icu",
148     "//url",
149     ":cryptohome_proto",
150     ":power_manager_proto",
151     ":test_support",
152   ]
153   sources = gypi_values.chromeos_test_sources
154   if (use_allocator != "none") {
155     deps += [ "//base/allocator" ]
156   }
159 proto_library("power_manager_proto") {
160   sources = [
161     "//third_party/cros_system_api/dbus/power_manager/input_event.proto",
162     "//third_party/cros_system_api/dbus/power_manager/peripheral_battery_status.proto",
163     "//third_party/cros_system_api/dbus/power_manager/policy.proto",
164     "//third_party/cros_system_api/dbus/power_manager/power_supply_properties.proto",
165     "//third_party/cros_system_api/dbus/power_manager/suspend.proto",
166   ]
168   proto_out_dir = "chromeos/dbus/power_manager"
171 proto_library("cryptohome_proto") {
172   sources = [
173     "//third_party/cros_system_api/dbus/cryptohome/key.proto",
174     "//third_party/cros_system_api/dbus/cryptohome/rpc.proto",
175   ]
177   proto_out_dir = "chromeos/dbus/cryptohome"
180 proto_library("cryptohome_signkey_proto") {
181   sources = [
182     "//third_party/cros_system_api/dbus/cryptohome/signed_secret.proto",
183   ]
185   proto_out_dir = "chromeos/cryptohome"