[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 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. |
| 4 | |
phosek | 636bceb3 | 2015-10-27 03:36:48 | [diff] [blame] | 5 | import("//build/config/nacl/config.gni") |
qsr | fb5251d1 | 2015-01-21 15:57:22 | [diff] [blame] | 6 | import("//testing/test.gni") |
ochang | cc11d0e | 2016-04-26 19:58:26 | [diff] [blame^] | 7 | import("//tools/ipc_fuzzer/ipc_fuzzer.gni") |
qsr | fb5251d1 | 2015-01-21 15:57:22 | [diff] [blame] | 8 | |
sdefresne | 8e7dcd4 | 2016-04-19 17:41:20 | [diff] [blame] | 9 | assert(!is_ios) |
| 10 | |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 11 | component("ipc") { |
| 12 | sources = [ |
erikchen | de9412b8 | 2015-07-27 18:26:14 | [diff] [blame] | 13 | "attachment_broker.cc", |
erikchen | 151b2f9 | 2015-06-16 20:20:51 | [diff] [blame] | 14 | "attachment_broker.h", |
erikchen | eece6c3 | 2015-07-07 22:13:11 | [diff] [blame] | 15 | "attachment_broker_messages.h", |
erikchen | 484c0084 | 2015-07-28 23:25:44 | [diff] [blame] | 16 | "attachment_broker_privileged.cc", |
| 17 | "attachment_broker_privileged.h", |
erikchen | b3481e2 | 2015-10-06 19:59:39 | [diff] [blame] | 18 | "attachment_broker_privileged_mac.cc", |
| 19 | "attachment_broker_privileged_mac.h", |
erikchen | c04ab34c | 2015-07-27 20:28:20 | [diff] [blame] | 20 | "attachment_broker_privileged_win.cc", |
| 21 | "attachment_broker_privileged_win.h", |
erikchen | 484c0084 | 2015-07-28 23:25:44 | [diff] [blame] | 22 | "attachment_broker_unprivileged.cc", |
| 23 | "attachment_broker_unprivileged.h", |
erikchen | b3481e2 | 2015-10-06 19:59:39 | [diff] [blame] | 24 | "attachment_broker_unprivileged_mac.cc", |
| 25 | "attachment_broker_unprivileged_mac.h", |
erikchen | 484c0084 | 2015-07-28 23:25:44 | [diff] [blame] | 26 | "attachment_broker_unprivileged_win.cc", |
| 27 | "attachment_broker_unprivileged_win.h", |
erikchen | 151b2f9 | 2015-06-16 20:20:51 | [diff] [blame] | 28 | "brokerable_attachment.cc", |
| 29 | "brokerable_attachment.h", |
erikchen | 3ee5d55e3 | 2015-10-09 23:20:49 | [diff] [blame] | 30 | "brokerable_attachment_mac.cc", |
erikchen | a5085cda | 2015-09-15 17:26:27 | [diff] [blame] | 31 | "brokerable_attachment_win.cc", |
mdempsky | 8a51904 | 2016-02-09 05:41:47 | [diff] [blame] | 32 | "export_template.h", |
erikchen | eece6c3 | 2015-07-07 22:13:11 | [diff] [blame] | 33 | "handle_attachment_win.cc", |
erikchen | 151b2f9 | 2015-06-16 20:20:51 | [diff] [blame] | 34 | "handle_attachment_win.h", |
erikchen | 959039d | 2015-08-11 21:17:47 | [diff] [blame] | 35 | "handle_win.cc", |
| 36 | "handle_win.h", |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 37 | "ipc_channel.cc", |
| 38 | "ipc_channel.h", |
scottmg | 7c7296f4 | 2015-02-28 02:23:09 | [diff] [blame] | 39 | "ipc_channel_common.cc", |
[email protected] | 6486088 | 2014-08-04 23:44:17 | [diff] [blame] | 40 | "ipc_channel_factory.cc", |
| 41 | "ipc_channel_factory.h", |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 42 | "ipc_channel_handle.h", |
| 43 | "ipc_channel_nacl.cc", |
| 44 | "ipc_channel_nacl.h", |
| 45 | "ipc_channel_posix.cc", |
| 46 | "ipc_channel_posix.h", |
| 47 | "ipc_channel_proxy.cc", |
| 48 | "ipc_channel_proxy.h", |
| 49 | "ipc_channel_reader.cc", |
| 50 | "ipc_channel_reader.h", |
| 51 | "ipc_channel_win.cc", |
| 52 | "ipc_channel_win.h", |
| 53 | "ipc_descriptors.h", |
erikchen | a09b9be7 | 2015-08-10 19:22:33 | [diff] [blame] | 54 | "ipc_endpoint.cc", |
| 55 | "ipc_endpoint.h", |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 56 | "ipc_export.h", |
erikchen | eece6c3 | 2015-07-07 22:13:11 | [diff] [blame] | 57 | "ipc_handle_win.cc", |
| 58 | "ipc_handle_win.h", |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 59 | "ipc_listener.h", |
| 60 | "ipc_logging.cc", |
| 61 | "ipc_logging.h", |
| 62 | "ipc_message.cc", |
| 63 | "ipc_message.h", |
morrita | 98b7aaa | 2015-01-26 22:42:54 | [diff] [blame] | 64 | "ipc_message_attachment.cc", |
| 65 | "ipc_message_attachment.h", |
morrita | 4b5c28e2 | 2015-01-14 21:17:06 | [diff] [blame] | 66 | "ipc_message_attachment_set.cc", |
| 67 | "ipc_message_attachment_set.h", |
erikchen | eece6c3 | 2015-07-07 22:13:11 | [diff] [blame] | 68 | "ipc_message_generator.cc", |
| 69 | "ipc_message_generator.h", |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 70 | "ipc_message_macros.h", |
| 71 | "ipc_message_start.h", |
mdempsky | 8a51904 | 2016-02-09 05:41:47 | [diff] [blame] | 72 | "ipc_message_templates.h", |
| 73 | "ipc_message_templates_impl.h", |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 74 | "ipc_message_utils.cc", |
| 75 | "ipc_message_utils.h", |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 76 | "ipc_platform_file.cc", |
| 77 | "ipc_platform_file.h", |
morrita | 1aa788c | 2015-01-31 05:45:42 | [diff] [blame] | 78 | "ipc_platform_file_attachment_posix.cc", |
| 79 | "ipc_platform_file_attachment_posix.h", |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 80 | "ipc_sender.h", |
| 81 | "ipc_switches.cc", |
| 82 | "ipc_switches.h", |
| 83 | "ipc_sync_channel.cc", |
| 84 | "ipc_sync_channel.h", |
| 85 | "ipc_sync_message.cc", |
| 86 | "ipc_sync_message.h", |
| 87 | "ipc_sync_message_filter.cc", |
| 88 | "ipc_sync_message_filter.h", |
erikchen | 1c1e665 | 2015-10-01 18:51:32 | [diff] [blame] | 89 | "mach_port_attachment_mac.cc", |
| 90 | "mach_port_attachment_mac.h", |
| 91 | "mach_port_mac.cc", |
| 92 | "mach_port_mac.h", |
[email protected] | 7412204 | 2014-04-25 00:07:30 | [diff] [blame] | 93 | "message_filter.cc", |
| 94 | "message_filter.h", |
| 95 | "message_filter_router.cc", |
| 96 | "message_filter_router.h", |
markdittmer | 638a149 | 2016-02-19 01:11:50 | [diff] [blame] | 97 | "message_router.cc", |
| 98 | "message_router.h", |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 99 | "param_traits_log_macros.h", |
| 100 | "param_traits_macros.h", |
| 101 | "param_traits_read_macros.h", |
| 102 | "param_traits_write_macros.h", |
erikchen | 87351da | 2015-09-15 19:11:09 | [diff] [blame] | 103 | "placeholder_brokerable_attachment.cc", |
| 104 | "placeholder_brokerable_attachment.h", |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 105 | "struct_constructor_macros.h", |
| 106 | "struct_destructor_macros.h", |
| 107 | "unix_domain_socket_util.cc", |
| 108 | "unix_domain_socket_util.h", |
| 109 | ] |
| 110 | |
phosek | 636bceb3 | 2015-10-27 03:36:48 | [diff] [blame] | 111 | if (is_nacl && !is_nacl_nonsfi) { |
dpranke | 6065cf7 | 2015-02-26 03:30:58 | [diff] [blame] | 112 | sources -= [ |
| 113 | "ipc_channel.cc", |
| 114 | "ipc_channel_posix.cc", |
| 115 | "unix_domain_socket_util.cc", |
| 116 | ] |
| 117 | } else { |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 118 | sources -= [ |
| 119 | "ipc_channel_nacl.cc", |
| 120 | "ipc_channel_nacl.h", |
| 121 | ] |
[email protected] | 517d528 | 2014-04-02 17:03:30 | [diff] [blame] | 122 | } |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 123 | |
phosek | 636bceb3 | 2015-10-27 03:36:48 | [diff] [blame] | 124 | if (is_win || is_ios || is_nacl_nonsfi) { |
scottmg | 34fb7e5 | 2014-12-03 23:27:24 | [diff] [blame] | 125 | sources -= [ "unix_domain_socket_util.cc" ] |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 126 | } |
| 127 | |
| 128 | defines = [ "IPC_IMPLEMENTATION" ] |
| 129 | |
brettw | b7f2c30 | 2015-12-08 01:29:21 | [diff] [blame] | 130 | public_deps = [ |
| 131 | ":param_traits", |
| 132 | ] |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 133 | deps = [ |
| 134 | "//base", |
scottmg | 34fb7e5 | 2014-12-03 23:27:24 | [diff] [blame] | 135 | |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 136 | # TODO(viettrungluu): Needed for base/lazy_instance.h, which is suspect. |
| 137 | "//base/third_party/dynamic_annotations", |
| 138 | ] |
Sergey Ulanov | 384a29c9 | 2015-09-14 17:11:35 | [diff] [blame] | 139 | |
erikchen | 3ee5d55e3 | 2015-10-09 23:20:49 | [diff] [blame] | 140 | if (is_win || is_mac) { |
| 141 | # On Windows HandleAttachmentWin needs to generate random IDs. |
| 142 | # On Mac MachPortAttachmentMac needs to generate random IDs. |
Sergey Ulanov | 384a29c9 | 2015-09-14 17:11:35 | [diff] [blame] | 143 | deps += [ "//crypto" ] |
| 144 | } |
ochang | cc11d0e | 2016-04-26 19:58:26 | [diff] [blame^] | 145 | |
| 146 | if (enable_ipc_fuzzer) { |
| 147 | public_configs = [ "//tools/ipc_fuzzer:ipc_fuzzer_config" ] |
| 148 | } |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 149 | } |
| 150 | |
brettw | b7f2c30 | 2015-12-08 01:29:21 | [diff] [blame] | 151 | # This is provided as a separate target so other targets can provide param |
| 152 | # traits implementations without necessarily linking to all of IPC. |
| 153 | source_set("param_traits") { |
| 154 | public = [ |
| 155 | "ipc_param_traits.h", |
| 156 | ] |
| 157 | } |
| 158 | |
pkotwicz | a553a3b | 2015-10-16 22:29:46 | [diff] [blame] | 159 | test("ipc_tests") { |
| 160 | sources = [ |
| 161 | "attachment_broker_mac_unittest.cc", |
| 162 | "attachment_broker_privileged_mac_unittest.cc", |
| 163 | "attachment_broker_privileged_win_unittest.cc", |
pkotwicz | a553a3b | 2015-10-16 22:29:46 | [diff] [blame] | 164 | "ipc_channel_posix_unittest.cc", |
| 165 | "ipc_channel_proxy_unittest.cc", |
| 166 | "ipc_channel_reader_unittest.cc", |
| 167 | "ipc_channel_unittest.cc", |
| 168 | "ipc_fuzzing_tests.cc", |
| 169 | "ipc_message_attachment_set_posix_unittest.cc", |
| 170 | "ipc_message_unittest.cc", |
| 171 | "ipc_message_utils_unittest.cc", |
| 172 | "ipc_send_fds_test.cc", |
| 173 | "ipc_sync_channel_unittest.cc", |
| 174 | "ipc_sync_message_unittest.cc", |
| 175 | "ipc_sync_message_unittest.h", |
| 176 | "ipc_test_message_generator.cc", |
| 177 | "ipc_test_message_generator.h", |
| 178 | "ipc_test_messages.h", |
| 179 | "sync_socket_unittest.cc", |
| 180 | "unix_domain_socket_util_unittest.cc", |
| 181 | ] |
| 182 | |
| 183 | if (is_win || is_ios) { |
| 184 | sources -= [ "unix_domain_socket_util_unittest.cc" ] |
dpranke | 177c1e2 | 2015-07-22 23:07:43 | [diff] [blame] | 185 | } |
| 186 | |
brettw | a59908d2 | 2016-01-21 19:16:48 | [diff] [blame] | 187 | if (is_android) { |
| 188 | # These multiprocess tests don't work on Android. |
| 189 | sources -= [ "ipc_channel_unittest.cc" ] |
| 190 | } |
| 191 | |
pkotwicz | a553a3b | 2015-10-16 22:29:46 | [diff] [blame] | 192 | # TODO(brettw) hook up Android testing. |
| 193 | #if (is_android && gtest_target_type == "shared_library") { |
| 194 | # deps += "/testing/android/native_test.gyp:native_testNative_code" |
| 195 | #} |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 196 | |
pkotwicz | a553a3b | 2015-10-16 22:29:46 | [diff] [blame] | 197 | deps = [ |
| 198 | ":ipc", |
| 199 | ":test_support", |
| 200 | "//base", |
| 201 | "//base:i18n", |
| 202 | "//base/test:run_all_unittests", |
| 203 | "//base/test:test_support", |
| 204 | "//crypto", |
| 205 | "//testing/gtest", |
| 206 | ] |
kerrnel | dc059fe | 2016-04-12 16:39:06 | [diff] [blame] | 207 | |
| 208 | if (is_mac) { |
| 209 | deps += [ "//sandbox/mac:seatbelt" ] |
| 210 | } |
pkotwicz | a553a3b | 2015-10-16 22:29:46 | [diff] [blame] | 211 | } |
[email protected] | 5a8d516 | 2014-04-12 01:19:16 | [diff] [blame] | 212 | |
pkotwicz | a553a3b | 2015-10-16 22:29:46 | [diff] [blame] | 213 | test("ipc_perftests") { |
| 214 | sources = [ |
| 215 | "ipc_perftests.cc", |
| 216 | ] |
[email protected] | 5a8d516 | 2014-04-12 01:19:16 | [diff] [blame] | 217 | |
pkotwicz | a553a3b | 2015-10-16 22:29:46 | [diff] [blame] | 218 | # TODO(brettw) hook up Android testing. |
| 219 | #if (is_android && gtest_target_type == "shared_library") { |
| 220 | # deps += "/testing/android/native_test.gyp:native_testNative_code" |
| 221 | #} |
[email protected] | 517d528 | 2014-04-02 17:03:30 | [diff] [blame] | 222 | |
pkotwicz | a553a3b | 2015-10-16 22:29:46 | [diff] [blame] | 223 | deps = [ |
| 224 | ":ipc", |
| 225 | ":test_support", |
| 226 | "//base", |
| 227 | "//base:i18n", |
| 228 | "//base/test:test_support", |
| 229 | "//base/test:test_support_perf", |
| 230 | "//testing/gtest", |
| 231 | ] |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 232 | } |
| 233 | |
brettw | 298955fc | 2015-08-25 23:47:52 | [diff] [blame] | 234 | source_set("test_support") { |
Brett Wilson | 0c8745a | 2014-09-08 22:59:49 | [diff] [blame] | 235 | testonly = true |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 236 | sources = [ |
| 237 | "ipc_multiprocess_test.cc", |
| 238 | "ipc_multiprocess_test.h", |
morrita | 373af03b | 2014-09-09 19:35:24 | [diff] [blame] | 239 | "ipc_perftest_support.cc", |
| 240 | "ipc_perftest_support.h", |
brettw | 013b729f | 2015-01-12 08:03:47 | [diff] [blame] | 241 | "ipc_security_test_util.cc", |
| 242 | "ipc_security_test_util.h", |
[email protected] | 6486088 | 2014-08-04 23:44:17 | [diff] [blame] | 243 | "ipc_test_base.cc", |
| 244 | "ipc_test_base.h", |
[email protected] | 6486088 | 2014-08-04 23:44:17 | [diff] [blame] | 245 | "ipc_test_channel_listener.cc", |
brettw | 013b729f | 2015-01-12 08:03:47 | [diff] [blame] | 246 | "ipc_test_channel_listener.h", |
| 247 | "ipc_test_sink.cc", |
| 248 | "ipc_test_sink.h", |
erikchen | 89d7423 | 2015-10-12 18:24:01 | [diff] [blame] | 249 | "test_util_mac.cc", |
| 250 | "test_util_mac.h", |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 251 | ] |
brettw | b7f2c30 | 2015-12-08 01:29:21 | [diff] [blame] | 252 | public_deps = [ |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 253 | ":ipc", |
brettw | b7f2c30 | 2015-12-08 01:29:21 | [diff] [blame] | 254 | ] |
| 255 | deps = [ |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 256 | "//base", |
brettw | e75311d | 2015-02-17 23:56:46 | [diff] [blame] | 257 | "//base/test:test_support", |
[email protected] | 23e197d | 2013-12-31 12:14:01 | [diff] [blame] | 258 | "//testing/gtest", |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 259 | ] |
| 260 | } |