blob: ae644904a8e36266cadf9af115ebc9a897328e7d [file] [log] [blame]
[email protected]7603bbd12013-08-13 17:33:371# 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.
4
qsrfb5251d12015-01-21 15:57:225import("//testing/test.gni")
6
[email protected]7603bbd12013-08-13 17:33:377component("ipc") {
8 sources = [
erikchende9412b82015-07-27 18:26:149 "attachment_broker.cc",
erikchen151b2f92015-06-16 20:20:5110 "attachment_broker.h",
erikcheneece6c32015-07-07 22:13:1111 "attachment_broker_messages.h",
erikchen484c00842015-07-28 23:25:4412 "attachment_broker_privileged.cc",
13 "attachment_broker_privileged.h",
erikchenb3481e22015-10-06 19:59:3914 "attachment_broker_privileged_mac.cc",
15 "attachment_broker_privileged_mac.h",
erikchenc04ab34c2015-07-27 20:28:2016 "attachment_broker_privileged_win.cc",
17 "attachment_broker_privileged_win.h",
erikchen484c00842015-07-28 23:25:4418 "attachment_broker_unprivileged.cc",
19 "attachment_broker_unprivileged.h",
erikchenb3481e22015-10-06 19:59:3920 "attachment_broker_unprivileged_mac.cc",
21 "attachment_broker_unprivileged_mac.h",
erikchen484c00842015-07-28 23:25:4422 "attachment_broker_unprivileged_win.cc",
23 "attachment_broker_unprivileged_win.h",
erikchen151b2f92015-06-16 20:20:5124 "brokerable_attachment.cc",
25 "brokerable_attachment.h",
erikchena5085cda2015-09-15 17:26:2726 "brokerable_attachment_win.cc",
erikcheneece6c32015-07-07 22:13:1127 "handle_attachment_win.cc",
erikchen151b2f92015-06-16 20:20:5128 "handle_attachment_win.h",
erikchen959039d2015-08-11 21:17:4729 "handle_win.cc",
30 "handle_win.h",
[email protected]7603bbd12013-08-13 17:33:3731 "ipc_channel.cc",
32 "ipc_channel.h",
scottmg7c7296f42015-02-28 02:23:0933 "ipc_channel_common.cc",
[email protected]64860882014-08-04 23:44:1734 "ipc_channel_factory.cc",
35 "ipc_channel_factory.h",
[email protected]7603bbd12013-08-13 17:33:3736 "ipc_channel_handle.h",
37 "ipc_channel_nacl.cc",
38 "ipc_channel_nacl.h",
39 "ipc_channel_posix.cc",
40 "ipc_channel_posix.h",
41 "ipc_channel_proxy.cc",
42 "ipc_channel_proxy.h",
43 "ipc_channel_reader.cc",
44 "ipc_channel_reader.h",
45 "ipc_channel_win.cc",
46 "ipc_channel_win.h",
47 "ipc_descriptors.h",
erikchena09b9be72015-08-10 19:22:3348 "ipc_endpoint.cc",
49 "ipc_endpoint.h",
[email protected]7603bbd12013-08-13 17:33:3750 "ipc_export.h",
erikcheneece6c32015-07-07 22:13:1151 "ipc_handle_win.cc",
52 "ipc_handle_win.h",
[email protected]7603bbd12013-08-13 17:33:3753 "ipc_listener.h",
54 "ipc_logging.cc",
55 "ipc_logging.h",
56 "ipc_message.cc",
57 "ipc_message.h",
morrita98b7aaa2015-01-26 22:42:5458 "ipc_message_attachment.cc",
59 "ipc_message_attachment.h",
morrita4b5c28e22015-01-14 21:17:0660 "ipc_message_attachment_set.cc",
61 "ipc_message_attachment_set.h",
erikcheneece6c32015-07-07 22:13:1162 "ipc_message_generator.cc",
63 "ipc_message_generator.h",
[email protected]7603bbd12013-08-13 17:33:3764 "ipc_message_macros.h",
65 "ipc_message_start.h",
66 "ipc_message_utils.cc",
67 "ipc_message_utils.h",
68 "ipc_param_traits.h",
69 "ipc_platform_file.cc",
70 "ipc_platform_file.h",
morrita1aa788c2015-01-31 05:45:4271 "ipc_platform_file_attachment_posix.cc",
72 "ipc_platform_file_attachment_posix.h",
[email protected]7603bbd12013-08-13 17:33:3773 "ipc_sender.h",
74 "ipc_switches.cc",
75 "ipc_switches.h",
76 "ipc_sync_channel.cc",
77 "ipc_sync_channel.h",
78 "ipc_sync_message.cc",
79 "ipc_sync_message.h",
80 "ipc_sync_message_filter.cc",
81 "ipc_sync_message_filter.h",
erikchen1c1e6652015-10-01 18:51:3282 "mach_port_attachment_mac.cc",
83 "mach_port_attachment_mac.h",
84 "mach_port_mac.cc",
85 "mach_port_mac.h",
[email protected]74122042014-04-25 00:07:3086 "message_filter.cc",
87 "message_filter.h",
88 "message_filter_router.cc",
89 "message_filter_router.h",
[email protected]7603bbd12013-08-13 17:33:3790 "param_traits_log_macros.h",
91 "param_traits_macros.h",
92 "param_traits_read_macros.h",
93 "param_traits_write_macros.h",
erikchen87351da2015-09-15 19:11:0994 "placeholder_brokerable_attachment.cc",
95 "placeholder_brokerable_attachment.h",
[email protected]7603bbd12013-08-13 17:33:3796 "struct_constructor_macros.h",
97 "struct_destructor_macros.h",
98 "unix_domain_socket_util.cc",
99 "unix_domain_socket_util.h",
100 ]
101
dpranke6065cf72015-02-26 03:30:58102 if (is_nacl) {
103 sources -= [
104 "ipc_channel.cc",
105 "ipc_channel_posix.cc",
106 "unix_domain_socket_util.cc",
107 ]
108 } else {
[email protected]7603bbd12013-08-13 17:33:37109 sources -= [
110 "ipc_channel_nacl.cc",
111 "ipc_channel_nacl.h",
112 ]
[email protected]517d5282014-04-02 17:03:30113 }
[email protected]7603bbd12013-08-13 17:33:37114
115 if (is_win || is_ios) {
scottmg34fb7e52014-12-03 23:27:24116 sources -= [ "unix_domain_socket_util.cc" ]
[email protected]7603bbd12013-08-13 17:33:37117 }
118
119 defines = [ "IPC_IMPLEMENTATION" ]
120
121 deps = [
122 "//base",
scottmg34fb7e52014-12-03 23:27:24123
[email protected]7603bbd12013-08-13 17:33:37124 # TODO(viettrungluu): Needed for base/lazy_instance.h, which is suspect.
125 "//base/third_party/dynamic_annotations",
126 ]
Sergey Ulanov384a29c92015-09-14 17:11:35127
128 if (is_win) {
129 # On windows HandleAttachmentWin needs to generate random IDs.
130 deps += [ "//crypto" ]
131 }
[email protected]7603bbd12013-08-13 17:33:37132}
133
dpranke6065cf72015-02-26 03:30:58134# TODO(GYP): crbug.com/360936. Get this to build and run on Android.
[email protected]5a8d5162014-04-12 01:19:16135if (!is_android) {
dpranke177c1e22015-07-22 23:07:43136 group("ipc_tests_run") {
137 testonly = true
138 deps = [
139 ":ipc_tests",
140 ]
141 }
142
[email protected]5a8d5162014-04-12 01:19:16143 test("ipc_tests") {
144 sources = [
erikchenb3481e22015-10-06 19:59:39145 "attachment_broker_privileged_mac_unittest.cc",
erikchenc04ab34c2015-07-27 20:28:20146 "attachment_broker_privileged_win_unittest.cc",
erikchen484c00842015-07-28 23:25:44147 "attachment_broker_unprivileged_win_unittest.cc",
[email protected]5a8d5162014-04-12 01:19:16148 "ipc_channel_posix_unittest.cc",
brettw298955fc2015-08-25 23:47:52149 "ipc_channel_proxy_unittest.cc",
erikchende9412b82015-07-27 18:26:14150 "ipc_channel_reader_unittest.cc",
[email protected]5a8d5162014-04-12 01:19:16151 "ipc_channel_unittest.cc",
152 "ipc_fuzzing_tests.cc",
morrita4b5c28e22015-01-14 21:17:06153 "ipc_message_attachment_set_posix_unittest.cc",
[email protected]5a8d5162014-04-12 01:19:16154 "ipc_message_unittest.cc",
155 "ipc_message_utils_unittest.cc",
156 "ipc_send_fds_test.cc",
157 "ipc_sync_channel_unittest.cc",
158 "ipc_sync_message_unittest.cc",
159 "ipc_sync_message_unittest.h",
erikchen98daa732015-09-25 18:30:03160 "ipc_test_message_generator.cc",
161 "ipc_test_message_generator.h",
162 "ipc_test_messages.h",
[email protected]5a8d5162014-04-12 01:19:16163 "sync_socket_unittest.cc",
164 "unix_domain_socket_util_unittest.cc",
165 ]
[email protected]7603bbd12013-08-13 17:33:37166
[email protected]5a8d5162014-04-12 01:19:16167 if (is_win || is_ios) {
168 sources -= [ "unix_domain_socket_util_unittest.cc" ]
169 }
170
171 # TODO(brettw) hook up Android testing.
172 #if (is_android && gtest_target_type == "shared_library") {
173 # deps += "/testing/android/native_test.gyp:native_testNative_code"
174 #}
175
176 # TODO(brettw) hook up tcmalloc to this target.
177 #if (is_posix && !is_mac && !is_android) {
[email protected]2fa89ef2014-05-07 18:45:59178 # if (use_allocator!="none") {
[email protected]5a8d5162014-04-12 01:19:16179 # deps += "/base/allocator"
180 # }
181 #}
182
183 deps = [
184 ":ipc",
[email protected]df82b4f52014-07-23 20:21:50185 ":test_support",
[email protected]5a8d5162014-04-12 01:19:16186 "//base",
187 "//base:i18n",
188 "//base/test:run_all_unittests",
189 "//base/test:test_support",
Sergey Ulanov384a29c92015-09-14 17:11:35190 "//crypto",
[email protected]5a8d5162014-04-12 01:19:16191 "//testing/gtest",
192 ]
[email protected]7603bbd12013-08-13 17:33:37193 }
[email protected]517d5282014-04-02 17:03:30194
[email protected]5a8d5162014-04-12 01:19:16195 test("ipc_perftests") {
196 sources = [
197 "ipc_perftests.cc",
[email protected]5a8d5162014-04-12 01:19:16198 ]
[email protected]517d5282014-04-02 17:03:30199
[email protected]5a8d5162014-04-12 01:19:16200 # TODO(brettw) hook up Android testing.
201 #if (is_android && gtest_target_type == "shared_library") {
202 # deps += "/testing/android/native_test.gyp:native_testNative_code"
203 #}
[email protected]7603bbd12013-08-13 17:33:37204
[email protected]5a8d5162014-04-12 01:19:16205 # TODO(brettw) hook up tcmalloc to this target.
206 #if (is_posix && !is_mac && !is_android) {
[email protected]2fa89ef2014-05-07 18:45:59207 # if (use_allocator!="none") {
[email protected]5a8d5162014-04-12 01:19:16208 # deps += "//base/allocator"
209 # }
210 #}
[email protected]5a8d5162014-04-12 01:19:16211 deps = [
212 ":ipc",
[email protected]df82b4f52014-07-23 20:21:50213 ":test_support",
[email protected]5a8d5162014-04-12 01:19:16214 "//base",
215 "//base:i18n",
216 "//base/test:test_support",
217 "//base/test:test_support_perf",
218 "//testing/gtest",
219 ]
220 }
[email protected]7603bbd12013-08-13 17:33:37221}
222
brettw298955fc2015-08-25 23:47:52223source_set("test_support") {
Brett Wilson0c8745a2014-09-08 22:59:49224 testonly = true
[email protected]7603bbd12013-08-13 17:33:37225 sources = [
226 "ipc_multiprocess_test.cc",
227 "ipc_multiprocess_test.h",
morrita373af03b2014-09-09 19:35:24228 "ipc_perftest_support.cc",
229 "ipc_perftest_support.h",
brettw013b729f2015-01-12 08:03:47230 "ipc_security_test_util.cc",
231 "ipc_security_test_util.h",
[email protected]64860882014-08-04 23:44:17232 "ipc_test_base.cc",
233 "ipc_test_base.h",
[email protected]64860882014-08-04 23:44:17234 "ipc_test_channel_listener.cc",
brettw013b729f2015-01-12 08:03:47235 "ipc_test_channel_listener.h",
236 "ipc_test_sink.cc",
237 "ipc_test_sink.h",
[email protected]7603bbd12013-08-13 17:33:37238 ]
239 deps = [
240 ":ipc",
241 "//base",
brettwe75311d2015-02-17 23:56:46242 "//base/test:test_support",
[email protected]23e197d2013-12-31 12:14:01243 "//testing/gtest",
[email protected]7603bbd12013-08-13 17:33:37244 ]
245}