Navigation transitions: Added very basic origin check for allowed destination URLs
[chromium-blink-merge.git] / chromeos / BUILD.gn
blob1d445fd08d6a7baffb744dc0c1fddbd108705699
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("//build/gypi_to_gn.py",
12                           [ rebase_path("chromeos.gyp") ],
13                           "scope",
14                           [ "chromeos.gyp" ])
16 component("chromeos") {
17   configs += [ "//net/third_party/nss/ssl:ssl_config" ]
18   public_deps = [
19     "//dbus",
20   ]
21   deps = [
22     "//base",
23     "//base:prefs",
24     "//base/third_party/dynamic_annotations",
25     "//chromeos/ime:gencode",
26     "//components/policy/proto",
27     "//components/onc",
28     "//crypto",
29     "//google_apis",
30     "//net/third_party/nss/ssl:libssl",
31     "//third_party/icu",
32     "//third_party/libxml",
33     "//third_party/protobuf:protobuf_lite",
34     "//ui/accelerometer",
35     "//url",
36     ":cryptohome_proto",
37     ":power_manager_proto",
38   ]
39   sources = gypi_values.chromeos_sources
40   defines = [ "CHROMEOS_IMPLEMENTATION" ]
43 static_library("test_support") {
44   testonly = true
45   configs += [ "//build/config/linux:dbus" ]
46   deps = [
47     "//testing/gmock",
48     ":chromeos",
49     ":cryptohome_proto",
50     ":power_manager_proto",
51     ":test_support_without_gmock",
52   ]
53   sources = [
54     "attestation/mock_attestation_flow.cc",
55     "attestation/mock_attestation_flow.h",
56     "chromeos_test_utils.cc",
57     "chromeos_test_utils.h",
58     "cryptohome/mock_async_method_caller.cc",
59     "cryptohome/mock_async_method_caller.h",
60     "cryptohome/mock_homedir_methods.cc",
61     "cryptohome/mock_homedir_methods.h",
62     "dbus/mock_cryptohome_client.cc",
63     "dbus/mock_cryptohome_client.h",
64     "dbus/mock_lorgnette_manager_client.cc",
65     "dbus/mock_lorgnette_manager_client.h",
66     "dbus/mock_session_manager_client.cc",
67     "dbus/mock_session_manager_client.h",
68     "dbus/mock_shill_manager_client.cc",
69     "dbus/mock_shill_manager_client.h",
70     "dbus/mock_shill_profile_client.cc",
71     "dbus/mock_shill_profile_client.h",
72     "dbus/mock_shill_service_client.cc",
73     "dbus/mock_shill_service_client.h",
74     "dbus/services/service_provider_test_helper.cc",
75     "dbus/services/service_provider_test_helper.h",
76     "disks/mock_disk_mount_manager.cc",
77     "disks/mock_disk_mount_manager.h",
78     "login/auth/mock_auth_attempt_state_resolver.cc",
79     "login/auth/mock_auth_attempt_state_resolver.h",
80     "login/auth/mock_auth_status_consumer.cc",
81     "login/auth/mock_auth_status_consumer.h",
82     "login/auth/mock_authenticator.cc",
83     "login/auth/mock_authenticator.h",
84     "login/auth/mock_url_fetchers.cc",
85     "login/auth/mock_url_fetchers.h",
86     "network/fake_network_device_handler.cc",
87     "network/fake_network_device_handler.h",
88     "network/mock_managed_network_configuration_handler.cc",
89     "network/mock_managed_network_configuration_handler.h",
90     "network/onc/onc_test_utils.cc",
91     "network/onc/onc_test_utils.h",
92     "system/fake_statistics_provider.cc",
93     "system/fake_statistics_provider.h",
94   ]
97 static_library("test_support_without_gmock") {
98   testonly = true
99   configs += [ "//build/config/linux:dbus" ]
100   deps = [
101     "//crypto",
102     ":chromeos",
103     ":cryptohome_proto",
104     ":power_manager_proto",
105   ]
106   sources = [
107     "dbus/fake_cros_disks_client.cc",
108     "dbus/fake_cros_disks_client.h",
109     "dbus/fake_power_manager_client.cc",
110     "dbus/fake_power_manager_client.h",
111     "dbus/fake_session_manager_client.cc",
112     "dbus/fake_session_manager_client.h",
113     "dbus/fake_shill_manager_client.cc",
114     "dbus/fake_shill_manager_client.h",
115     "dbus/fake_update_engine_client.cc",
116     "dbus/fake_update_engine_client.h",
117   ]
120 test("chromeos_unittests") {
121   configs += [
122     "//build/config/linux:dbus",
123     "//net/third_party/nss/ssl:ssl_config",
124   ]
125   deps = [
126     "//base:prefs_test_support",
127     "//base/test:run_all_unittests",
128     "//base/test:test_support",
129     "//components/onc",
130     "//content/test:test_support",
131     "//crypto",
132     "//crypto:test_support",
133     "//dbus:test_support",
134     "//google_apis",
135     "//net",
136     "//net:test_support",
137     "//testing/gmock",
138     "//testing/gtest",
139     "//url",
140     ":cryptohome_proto",
141     ":power_manager_proto",
142     ":test_support",
143   ]
144   sources = gypi_values.chromeos_test_sources
145   if (use_allocator != "none") {
146     deps += [ "//base/allocator" ]
147   }
148   if (use_x11) {
149     deps += [ "//ui/gfx/x" ]
150   }
153 proto_library("power_manager_proto") {
154   sources = [
155     "//third_party/cros_system_api/dbus/power_manager/input_event.proto",
156     "//third_party/cros_system_api/dbus/power_manager/peripheral_battery_status.proto",
157     "//third_party/cros_system_api/dbus/power_manager/policy.proto",
158     "//third_party/cros_system_api/dbus/power_manager/power_supply_properties.proto",
159     "//third_party/cros_system_api/dbus/power_manager/suspend.proto",
160   ]
162   proto_out_dir = "chromeos/dbus/power_manager"
165 proto_library("cryptohome_proto") {
166   sources = [
167     "//third_party/cros_system_api/dbus/cryptohome/key.proto",
168     "//third_party/cros_system_api/dbus/cryptohome/rpc.proto",
169   ]
171   proto_out_dir = "chromeos/dbus/cryptohome"
174 proto_library("cryptohome_signkey_proto") {
175   sources = [
176     "//third_party/cros_system_api/dbus/cryptohome/signed_secret.proto",
177   ]
179   proto_out_dir = "chromeos/cryptohome"