view-manager: Create the root-view only when the viewport-metrics are known.
[chromium-blink-merge.git] / ipc / BUILD.gn
blobce725744753c4b208390a8b73a44bf41f5770515
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.h",
10     "attachment_broker_messages.h",
11     "attachment_broker_win.cc",
12     "attachment_broker_win.h",
13     "brokerable_attachment.cc",
14     "brokerable_attachment.h",
15     "handle_attachment_win.cc",
16     "handle_attachment_win.h",
17     "ipc_channel.cc",
18     "ipc_channel.h",
19     "ipc_channel_common.cc",
20     "ipc_channel_factory.cc",
21     "ipc_channel_factory.h",
22     "ipc_channel_handle.h",
23     "ipc_channel_nacl.cc",
24     "ipc_channel_nacl.h",
25     "ipc_channel_posix.cc",
26     "ipc_channel_posix.h",
27     "ipc_channel_proxy.cc",
28     "ipc_channel_proxy.h",
29     "ipc_channel_reader.cc",
30     "ipc_channel_reader.h",
31     "ipc_channel_win.cc",
32     "ipc_channel_win.h",
33     "ipc_descriptors.h",
34     "ipc_export.h",
35     "ipc_forwarding_message_filter.cc",
36     "ipc_forwarding_message_filter.h",
37     "ipc_handle_win.cc",
38     "ipc_handle_win.h",
39     "ipc_listener.h",
40     "ipc_logging.cc",
41     "ipc_logging.h",
42     "ipc_message.cc",
43     "ipc_message.h",
44     "ipc_message_attachment.cc",
45     "ipc_message_attachment.h",
46     "ipc_message_attachment_set.cc",
47     "ipc_message_attachment_set.h",
48     "ipc_message_generator.cc",
49     "ipc_message_generator.h",
50     "ipc_message_macros.h",
51     "ipc_message_start.h",
52     "ipc_message_utils.cc",
53     "ipc_message_utils.h",
54     "ipc_param_traits.h",
55     "ipc_platform_file.cc",
56     "ipc_platform_file.h",
57     "ipc_platform_file_attachment_posix.cc",
58     "ipc_platform_file_attachment_posix.h",
59     "ipc_sender.h",
60     "ipc_switches.cc",
61     "ipc_switches.h",
62     "ipc_sync_channel.cc",
63     "ipc_sync_channel.h",
64     "ipc_sync_message.cc",
65     "ipc_sync_message.h",
66     "ipc_sync_message_filter.cc",
67     "ipc_sync_message_filter.h",
68     "message_filter.cc",
69     "message_filter.h",
70     "message_filter_router.cc",
71     "message_filter_router.h",
72     "param_traits_log_macros.h",
73     "param_traits_macros.h",
74     "param_traits_read_macros.h",
75     "param_traits_write_macros.h",
76     "struct_constructor_macros.h",
77     "struct_destructor_macros.h",
78     "unix_domain_socket_util.cc",
79     "unix_domain_socket_util.h",
80   ]
82   if (is_nacl) {
83     sources -= [
84       "ipc_channel.cc",
85       "ipc_channel_posix.cc",
86       "unix_domain_socket_util.cc",
87     ]
88   } else {
89     sources -= [
90       "ipc_channel_nacl.cc",
91       "ipc_channel_nacl.h",
92     ]
93   }
95   if (is_win || is_ios) {
96     sources -= [ "unix_domain_socket_util.cc" ]
97   }
99   defines = [ "IPC_IMPLEMENTATION" ]
101   deps = [
102     "//base",
104     # TODO(viettrungluu): Needed for base/lazy_instance.h, which is suspect.
105     "//base/third_party/dynamic_annotations",
106     "//crypto:crypto",
107   ]
110 # TODO(GYP): crbug.com/360936. Get this to build and run on Android.
111 if (!is_android) {
112   test("ipc_tests") {
113     sources = [
114       "attachment_broker_win_unittest.cc",
115       "ipc_channel_posix_unittest.cc",
116       "ipc_channel_unittest.cc",
117       "ipc_fuzzing_tests.cc",
118       "ipc_message_attachment_set_posix_unittest.cc",
119       "ipc_message_unittest.cc",
120       "ipc_message_utils_unittest.cc",
121       "ipc_send_fds_test.cc",
122       "ipc_sync_channel_unittest.cc",
123       "ipc_sync_message_unittest.cc",
124       "ipc_sync_message_unittest.h",
125       "sync_socket_unittest.cc",
126       "unix_domain_socket_util_unittest.cc",
127     ]
129     if (is_win || is_ios) {
130       sources -= [ "unix_domain_socket_util_unittest.cc" ]
131     }
133     # TODO(brettw) hook up Android testing.
134     #if (is_android && gtest_target_type == "shared_library") {
135     #  deps += "/testing/android/native_test.gyp:native_testNative_code"
136     #}
138     # TODO(brettw) hook up tcmalloc to this target.
139     #if (is_posix && !is_mac && !is_android) {
140     #  if (use_allocator!="none") {
141     #    deps += "/base/allocator"
142     #  }
143     #}
145     deps = [
146       ":ipc",
147       ":test_support",
148       "//base",
149       "//base:i18n",
150       "//base/test:run_all_unittests",
151       "//base/test:test_support",
152       "//testing/gtest",
153     ]
154   }
156   test("ipc_perftests") {
157     sources = [
158       "ipc_perftests.cc",
159     ]
161     # TODO(brettw) hook up Android testing.
162     #if (is_android && gtest_target_type == "shared_library") {
163     #  deps += "/testing/android/native_test.gyp:native_testNative_code"
164     #}
166     # TODO(brettw) hook up tcmalloc to this target.
167     #if (is_posix && !is_mac && !is_android) {
168     #  if (use_allocator!="none") {
169     #    deps += "//base/allocator"
170     #  }
171     #}
172     deps = [
173       ":ipc",
174       ":test_support",
175       "//base",
176       "//base:i18n",
177       "//base/test:test_support",
178       "//base/test:test_support_perf",
179       "//testing/gtest",
180     ]
181   }
184 static_library("test_support") {
185   testonly = true
186   sources = [
187     "ipc_multiprocess_test.cc",
188     "ipc_multiprocess_test.h",
189     "ipc_perftest_support.cc",
190     "ipc_perftest_support.h",
191     "ipc_security_test_util.cc",
192     "ipc_security_test_util.h",
193     "ipc_test_base.cc",
194     "ipc_test_base.h",
195     "ipc_test_channel_listener.cc",
196     "ipc_test_channel_listener.h",
197     "ipc_test_sink.cc",
198     "ipc_test_sink.h",
199   ]
200   deps = [
201     ":ipc",
202     "//base",
203     "//base/test:test_support",
204     "//testing/gtest",
205   ]