NaCl: Update revision in DEPS, 2363d1a -> 66f4b73
[chromium-blink-merge.git] / chromeos / BUILD.gn
blob5e5c3b854f252c662608d06aa2061bfc602541f2
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/policy/proto",
29     "//components/onc",
30     "//crypto",
31     "//crypto:platform",
32     "//google_apis",
33     "//net/third_party/nss/ssl:libssl",
34     "//third_party/icu",
35     "//third_party/libxml",
36     "//third_party/protobuf:protobuf_lite",
37     "//url",
38     ":cryptohome_proto",
39     ":power_manager_proto",
40   ]
41   sources = gypi_values.chromeos_sources
42   defines = [ "CHROMEOS_IMPLEMENTATION" ]
45 static_library("test_support") {
46   testonly = true
47   configs += [ "//build/config/linux:dbus" ]
48   deps = [
49     "//testing/gmock",
50     ":chromeos",
51     ":cryptohome_proto",
52     ":power_manager_proto",
53     ":test_support_without_gmock",
54   ]
55   sources = [
56     "attestation/mock_attestation_flow.cc",
57     "attestation/mock_attestation_flow.h",
58     "chromeos_test_utils.cc",
59     "chromeos_test_utils.h",
60     "cryptohome/mock_async_method_caller.cc",
61     "cryptohome/mock_async_method_caller.h",
62     "cryptohome/mock_homedir_methods.cc",
63     "cryptohome/mock_homedir_methods.h",
64     "dbus/mock_cryptohome_client.cc",
65     "dbus/mock_cryptohome_client.h",
66     "dbus/mock_lorgnette_manager_client.cc",
67     "dbus/mock_lorgnette_manager_client.h",
68     "dbus/mock_session_manager_client.cc",
69     "dbus/mock_session_manager_client.h",
70     "dbus/mock_shill_manager_client.cc",
71     "dbus/mock_shill_manager_client.h",
72     "dbus/mock_shill_profile_client.cc",
73     "dbus/mock_shill_profile_client.h",
74     "dbus/mock_shill_service_client.cc",
75     "dbus/mock_shill_service_client.h",
76     "dbus/services/service_provider_test_helper.cc",
77     "dbus/services/service_provider_test_helper.h",
78     "disks/mock_disk_mount_manager.cc",
79     "disks/mock_disk_mount_manager.h",
80     "login/auth/fake_extended_authenticator.cc",
81     "login/auth/fake_extended_authenticator.h",
82     "login/auth/mock_auth_attempt_state_resolver.cc",
83     "login/auth/mock_auth_attempt_state_resolver.h",
84     "login/auth/mock_auth_status_consumer.cc",
85     "login/auth/mock_auth_status_consumer.h",
86     "login/auth/mock_url_fetchers.cc",
87     "login/auth/mock_url_fetchers.h",
88     "network/fake_network_device_handler.cc",
89     "network/fake_network_device_handler.h",
90     "network/mock_managed_network_configuration_handler.cc",
91     "network/mock_managed_network_configuration_handler.h",
92     "network/onc/onc_test_utils.cc",
93     "network/onc/onc_test_utils.h",
94     "system/fake_statistics_provider.cc",
95     "system/fake_statistics_provider.h",
96   ]
99 static_library("test_support_without_gmock") {
100   testonly = true
101   configs += [ "//build/config/linux:dbus" ]
102   deps = [
103     "//crypto",
104     ":chromeos",
105     ":cryptohome_proto",
106     ":power_manager_proto",
107   ]
108   sources = [
109     "dbus/fake_cros_disks_client.cc",
110     "dbus/fake_cros_disks_client.h",
111     "dbus/fake_power_manager_client.cc",
112     "dbus/fake_power_manager_client.h",
113     "dbus/fake_session_manager_client.cc",
114     "dbus/fake_session_manager_client.h",
115     "dbus/fake_shill_manager_client.cc",
116     "dbus/fake_shill_manager_client.h",
117     "dbus/fake_update_engine_client.cc",
118     "dbus/fake_update_engine_client.h",
119   ]
122 test("chromeos_unittests") {
123   configs += [
124     "//build/config/linux:dbus",
125     "//net/third_party/nss/ssl:ssl_config",
126   ]
127   deps = [
128     "//base:prefs_test_support",
129     "//base/test:run_all_unittests",
130     "//base/test:test_support",
131     "//components/onc",
132     "//crypto",
133     "//crypto:test_support",
134     "//dbus:test_support",
135     "//google_apis",
136     "//net",
137     "//net:test_support",
138     "//testing/gmock",
139     "//testing/gtest",
140     "//url",
141     ":cryptohome_proto",
142     ":power_manager_proto",
143     ":test_support",
144   ]
145   sources = gypi_values.chromeos_test_sources
146   if (use_allocator != "none") {
147     deps += [ "//base/allocator" ]
148   }
151 proto_library("power_manager_proto") {
152   sources = [
153     "//third_party/cros_system_api/dbus/power_manager/input_event.proto",
154     "//third_party/cros_system_api/dbus/power_manager/peripheral_battery_status.proto",
155     "//third_party/cros_system_api/dbus/power_manager/policy.proto",
156     "//third_party/cros_system_api/dbus/power_manager/power_supply_properties.proto",
157     "//third_party/cros_system_api/dbus/power_manager/suspend.proto",
158   ]
160   proto_out_dir = "chromeos/dbus/power_manager"
163 proto_library("cryptohome_proto") {
164   sources = [
165     "//third_party/cros_system_api/dbus/cryptohome/key.proto",
166     "//third_party/cros_system_api/dbus/cryptohome/rpc.proto",
167   ]
169   proto_out_dir = "chromeos/dbus/cryptohome"
172 proto_library("cryptohome_signkey_proto") {
173   sources = [
174     "//third_party/cros_system_api/dbus/cryptohome/signed_secret.proto",
175   ]
177   proto_out_dir = "chromeos/cryptohome"