Implement chrome://local-state debug URL.
[chromium-blink-merge.git] / chromeos / BUILD.gn
blob33c47b15e77daf7962d7bceaccb58fdeb08aecba
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("//third_party/protobuf/proto_library.gni")
9 assert(is_chromeos, "Non-ChromeOS builds must not depend on //chromeos")
11 gypi_values = exec_script(
12     "//build/gypi_to_gn.py",
13     [ rebase_path("chromeos.gyp") ],
14     "scope",
15     [ "chromeos.gyp" ])
17 component("chromeos") {
18   configs += [
19     "//net/third_party/nss/ssl:ssl_config",
20   ]
21   public_deps = [ "//dbus" ]
22   deps = [
23     "//base",
24     "//base:prefs",
25     "//base/third_party/dynamic_annotations",
26     "//chromeos/ime:gencode",
27     "//components/policy/proto",
28     "//components/onc",
29     "//crypto",
30     "//google_apis",
31     "//net/third_party/nss/ssl:libssl",
32     "//third_party/icu",
33     "//third_party/libxml",
34     "//third_party/protobuf:protobuf_lite",
35     "//ui/accelerometer",
36     "//url",
37     ":cryptohome_proto",
38     ":power_manager_proto"
39   ]
40   sources = gypi_values.chromeos_sources
41   defines = [ "CHROMEOS_IMPLEMENTATION" ]
42   if (use_x11) {
43     configs += [ "//build/config/linux:x11" ]
44     deps += [ "//ui/gfx/x" ]
45     sources -= [
46       "ime/ime_keyboard_ozone.cc",
47       "ime/ime_keyboard_ozone.h",
48     ]
49   } else {
50     sources -= [
51       "ime/ime_keyboard_x11.cc",
52       "ime/ime_keyboard_x11.h",
53     ]
54   }
57 static_library("test_support") {
58   testonly = true
59   configs += [
60     "//build/config/linux:dbus",
61   ]
62   deps = [
63     "//testing/gmock",
64     ":chromeos",
65     ":cryptohome_proto",
66     ":power_manager_proto",
67     ":test_support_without_gmock",
68   ]
69   sources = [
70     "attestation/mock_attestation_flow.cc",
71     "attestation/mock_attestation_flow.h",
72     "chromeos_test_utils.cc",
73     "chromeos_test_utils.h",
74     "cryptohome/mock_async_method_caller.cc",
75     "cryptohome/mock_async_method_caller.h",
76     "cryptohome/mock_homedir_methods.cc",
77     "cryptohome/mock_homedir_methods.h",
78     "dbus/mock_cryptohome_client.cc",
79     "dbus/mock_cryptohome_client.h",
80     "dbus/mock_lorgnette_manager_client.cc",
81     "dbus/mock_lorgnette_manager_client.h",
82     "dbus/mock_session_manager_client.cc",
83     "dbus/mock_session_manager_client.h",
84     "dbus/mock_shill_manager_client.cc",
85     "dbus/mock_shill_manager_client.h",
86     "dbus/mock_shill_profile_client.cc",
87     "dbus/mock_shill_profile_client.h",
88     "dbus/mock_shill_service_client.cc",
89     "dbus/mock_shill_service_client.h",
90     "dbus/services/service_provider_test_helper.cc",
91     "dbus/services/service_provider_test_helper.h",
92     "disks/mock_disk_mount_manager.cc",
93     "disks/mock_disk_mount_manager.h",
94     "ime/mock_component_extension_ime_manager_delegate.cc",
95     "ime/mock_component_extension_ime_manager_delegate.h",
96     "login/auth/mock_auth_attempt_state_resolver.cc",
97     "login/auth/mock_auth_attempt_state_resolver.h",
98     "login/auth/mock_auth_status_consumer.cc",
99     "login/auth/mock_auth_status_consumer.h",
100     "login/auth/mock_authenticator.cc",
101     "login/auth/mock_authenticator.h",
102     "login/auth/mock_url_fetchers.cc",
103     "login/auth/mock_url_fetchers.h",
104     "network/fake_network_device_handler.cc",
105     "network/fake_network_device_handler.h",
106     "network/mock_managed_network_configuration_handler.cc",
107     "network/mock_managed_network_configuration_handler.h",
108     "network/onc/onc_test_utils.cc",
109     "network/onc/onc_test_utils.h",
110     "system/fake_statistics_provider.cc",
111     "system/fake_statistics_provider.h",
112   ]
115 static_library("test_support_without_gmock") {
116   testonly = true
117   configs += [
118     "//build/config/linux:dbus",
119   ]
120   deps = [
121     "//crypto",
122     ":chromeos",
123     ":cryptohome_proto",
124     ":power_manager_proto",
125   ]
126   sources = [
127     "dbus/fake_cros_disks_client.cc",
128     "dbus/fake_cros_disks_client.h",
129     "dbus/fake_power_manager_client.cc",
130     "dbus/fake_power_manager_client.h",
131     "dbus/fake_session_manager_client.cc",
132     "dbus/fake_session_manager_client.h",
133     "dbus/fake_shill_manager_client.cc",
134     "dbus/fake_shill_manager_client.h",
135     "dbus/fake_update_engine_client.cc",
136     "dbus/fake_update_engine_client.h",
137     "ime/fake_input_method_delegate.cc",
138     "ime/fake_input_method_delegate.h",
139   ]
142 test("chromeos_unittests") {
143   configs += [
144     "//build/config/linux:dbus",
145     "//net/third_party/nss/ssl:ssl_config",
146   ]
147   deps = [
148     "//base/test:run_all_unittests",
149     "//base/test:test_support",
150     "//components/onc",
151     "//content/test:test_support",
152     "//crypto",
153     "//crypto:test_support",
154     "//dbus:test_support",
155     "//google_apis",
156     "//net",
157     "//net:test_support",
158     "//testing/gmock",
159     "//testing/gtest",
160     "//url",
161     ":cryptohome_proto",
162     ":power_manager_proto",
163     ":test_support",
164   ]
165   sources = gypi_values.chromeos_test_sources
166   if (use_allocator != "none") {
167     deps += [ "//base/allocator" ]
168   }
169   if (use_x11) {
170     deps += [ "//ui/gfx/x" ]
171   }
172   if (use_ozone) {
173     sources -= [
174       "ime/ime_keyboard_x11_unittest.cc",
175     ]
176   }
179 proto_library("power_manager_proto") {
180   sources = [
181     "//third_party/cros_system_api/dbus/power_manager/input_event.proto",
182     "//third_party/cros_system_api/dbus/power_manager/peripheral_battery_status.proto",
183     "//third_party/cros_system_api/dbus/power_manager/policy.proto",
184     "//third_party/cros_system_api/dbus/power_manager/power_supply_properties.proto",
185     "//third_party/cros_system_api/dbus/power_manager/suspend.proto",
186   ]
188   proto_out_dir = "chromeos/dbus/power_manager"
191 proto_library("cryptohome_proto") {
192   sources = [
193     "//third_party/cros_system_api/dbus/cryptohome/key.proto",
194     "//third_party/cros_system_api/dbus/cryptohome/rpc.proto",
195   ]
197   proto_out_dir = "chromeos/dbus/cryptohome"
200 proto_library("cryptohome_signkey_proto") {
201   sources = [
202     "//third_party/cros_system_api/dbus/cryptohome/signed_secret.proto",
203   ]
205   proto_out_dir = "chromeos/cryptohome"