Fix layout of the Connection Tab of the Origin Info Bubble.
[chromium-blink-merge.git] / ipc / BUILD.gn
blob71787bbfb5338f390d93fd3d66e188621cf48799
1 # Copyright (c) 2012 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("//testing/test.gni")
7 component("ipc") {
8   sources = [
9     "attachment_broker.cc",
10     "attachment_broker.h",
11     "attachment_broker_messages.h",
12     "attachment_broker_privileged.cc",
13     "attachment_broker_privileged.h",
14     "attachment_broker_privileged_win.cc",
15     "attachment_broker_privileged_win.h",
16     "attachment_broker_unprivileged.cc",
17     "attachment_broker_unprivileged.h",
18     "attachment_broker_unprivileged_win.cc",
19     "attachment_broker_unprivileged_win.h",
20     "brokerable_attachment.cc",
21     "brokerable_attachment.h",
22     "brokerable_attachment_win.cc",
23     "handle_attachment_win.cc",
24     "handle_attachment_win.h",
25     "handle_win.cc",
26     "handle_win.h",
27     "ipc_channel.cc",
28     "ipc_channel.h",
29     "ipc_channel_common.cc",
30     "ipc_channel_factory.cc",
31     "ipc_channel_factory.h",
32     "ipc_channel_handle.h",
33     "ipc_channel_nacl.cc",
34     "ipc_channel_nacl.h",
35     "ipc_channel_posix.cc",
36     "ipc_channel_posix.h",
37     "ipc_channel_proxy.cc",
38     "ipc_channel_proxy.h",
39     "ipc_channel_reader.cc",
40     "ipc_channel_reader.h",
41     "ipc_channel_win.cc",
42     "ipc_channel_win.h",
43     "ipc_descriptors.h",
44     "ipc_endpoint.cc",
45     "ipc_endpoint.h",
46     "ipc_export.h",
47     "ipc_handle_win.cc",
48     "ipc_handle_win.h",
49     "ipc_listener.h",
50     "ipc_logging.cc",
51     "ipc_logging.h",
52     "ipc_message.cc",
53     "ipc_message.h",
54     "ipc_message_attachment.cc",
55     "ipc_message_attachment.h",
56     "ipc_message_attachment_set.cc",
57     "ipc_message_attachment_set.h",
58     "ipc_message_generator.cc",
59     "ipc_message_generator.h",
60     "ipc_message_macros.h",
61     "ipc_message_start.h",
62     "ipc_message_utils.cc",
63     "ipc_message_utils.h",
64     "ipc_param_traits.h",
65     "ipc_platform_file.cc",
66     "ipc_platform_file.h",
67     "ipc_platform_file_attachment_posix.cc",
68     "ipc_platform_file_attachment_posix.h",
69     "ipc_sender.h",
70     "ipc_switches.cc",
71     "ipc_switches.h",
72     "ipc_sync_channel.cc",
73     "ipc_sync_channel.h",
74     "ipc_sync_message.cc",
75     "ipc_sync_message.h",
76     "ipc_sync_message_filter.cc",
77     "ipc_sync_message_filter.h",
78     "message_filter.cc",
79     "message_filter.h",
80     "message_filter_router.cc",
81     "message_filter_router.h",
82     "param_traits_log_macros.h",
83     "param_traits_macros.h",
84     "param_traits_read_macros.h",
85     "param_traits_write_macros.h",
86     "placeholder_brokerable_attachment.cc",
87     "placeholder_brokerable_attachment.h",
88     "struct_constructor_macros.h",
89     "struct_destructor_macros.h",
90     "unix_domain_socket_util.cc",
91     "unix_domain_socket_util.h",
92   ]
94   if (is_nacl) {
95     sources -= [
96       "ipc_channel.cc",
97       "ipc_channel_posix.cc",
98       "unix_domain_socket_util.cc",
99     ]
100   } else {
101     sources -= [
102       "ipc_channel_nacl.cc",
103       "ipc_channel_nacl.h",
104     ]
105   }
107   if (is_win || is_ios) {
108     sources -= [ "unix_domain_socket_util.cc" ]
109   }
111   defines = [ "IPC_IMPLEMENTATION" ]
113   deps = [
114     "//base",
116     # TODO(viettrungluu): Needed for base/lazy_instance.h, which is suspect.
117     "//base/third_party/dynamic_annotations",
118   ]
120   if (is_win) {
121     # On windows HandleAttachmentWin needs to generate random IDs.
122     deps += [ "//crypto" ]
123   }
126 # TODO(GYP): crbug.com/360936. Get this to build and run on Android.
127 if (!is_android) {
128   group("ipc_tests_run") {
129     testonly = true
130     deps = [
131       ":ipc_tests",
132     ]
133   }
135   test("ipc_tests") {
136     sources = [
137       "attachment_broker_privileged_win_unittest.cc",
138       "attachment_broker_unprivileged_win_unittest.cc",
139       "ipc_channel_posix_unittest.cc",
140       "ipc_channel_proxy_unittest.cc",
141       "ipc_channel_reader_unittest.cc",
142       "ipc_channel_unittest.cc",
143       "ipc_fuzzing_tests.cc",
144       "ipc_message_attachment_set_posix_unittest.cc",
145       "ipc_message_unittest.cc",
146       "ipc_message_utils_unittest.cc",
147       "ipc_send_fds_test.cc",
148       "ipc_sync_channel_unittest.cc",
149       "ipc_sync_message_unittest.cc",
150       "ipc_sync_message_unittest.h",
151       "sync_socket_unittest.cc",
152       "unix_domain_socket_util_unittest.cc",
153     ]
155     if (is_win || is_ios) {
156       sources -= [ "unix_domain_socket_util_unittest.cc" ]
157     }
159     # TODO(brettw) hook up Android testing.
160     #if (is_android && gtest_target_type == "shared_library") {
161     #  deps += "/testing/android/native_test.gyp:native_testNative_code"
162     #}
164     # TODO(brettw) hook up tcmalloc to this target.
165     #if (is_posix && !is_mac && !is_android) {
166     #  if (use_allocator!="none") {
167     #    deps += "/base/allocator"
168     #  }
169     #}
171     deps = [
172       ":ipc",
173       ":test_support",
174       "//base",
175       "//base:i18n",
176       "//base/test:run_all_unittests",
177       "//base/test:test_support",
178       "//crypto",
179       "//testing/gtest",
180     ]
181   }
183   test("ipc_perftests") {
184     sources = [
185       "ipc_perftests.cc",
186     ]
188     # TODO(brettw) hook up Android testing.
189     #if (is_android && gtest_target_type == "shared_library") {
190     #  deps += "/testing/android/native_test.gyp:native_testNative_code"
191     #}
193     # TODO(brettw) hook up tcmalloc to this target.
194     #if (is_posix && !is_mac && !is_android) {
195     #  if (use_allocator!="none") {
196     #    deps += "//base/allocator"
197     #  }
198     #}
199     deps = [
200       ":ipc",
201       ":test_support",
202       "//base",
203       "//base:i18n",
204       "//base/test:test_support",
205       "//base/test:test_support_perf",
206       "//testing/gtest",
207     ]
208   }
211 source_set("test_support") {
212   testonly = true
213   sources = [
214     "ipc_multiprocess_test.cc",
215     "ipc_multiprocess_test.h",
216     "ipc_perftest_support.cc",
217     "ipc_perftest_support.h",
218     "ipc_security_test_util.cc",
219     "ipc_security_test_util.h",
220     "ipc_test_base.cc",
221     "ipc_test_base.h",
222     "ipc_test_channel_listener.cc",
223     "ipc_test_channel_listener.h",
224     "ipc_test_sink.cc",
225     "ipc_test_sink.h",
226   ]
227   deps = [
228     ":ipc",
229     "//base",
230     "//base/test:test_support",
231     "//testing/gtest",
232   ]