[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 | |
qsr | fb5251d1 | 2015-01-21 15:57:22 | [diff] [blame] | 5 | import("//testing/test.gni") |
| 6 | |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 7 | component("ipc") { |
| 8 | sources = [ |
erikchen | de9412b8 | 2015-07-27 18:26:14 | [diff] [blame] | 9 | "attachment_broker.cc", |
erikchen | 151b2f9 | 2015-06-16 20:20:51 | [diff] [blame] | 10 | "attachment_broker.h", |
erikchen | eece6c3 | 2015-07-07 22:13:11 | [diff] [blame] | 11 | "attachment_broker_messages.h", |
erikchen | 484c0084 | 2015-07-28 23:25:44 | [diff] [blame] | 12 | "attachment_broker_privileged.cc", |
| 13 | "attachment_broker_privileged.h", |
erikchen | b3481e2 | 2015-10-06 19:59:39 | [diff] [blame^] | 14 | "attachment_broker_privileged_mac.cc", |
| 15 | "attachment_broker_privileged_mac.h", |
erikchen | c04ab34c | 2015-07-27 20:28:20 | [diff] [blame] | 16 | "attachment_broker_privileged_win.cc", |
| 17 | "attachment_broker_privileged_win.h", |
erikchen | 484c0084 | 2015-07-28 23:25:44 | [diff] [blame] | 18 | "attachment_broker_unprivileged.cc", |
| 19 | "attachment_broker_unprivileged.h", |
erikchen | b3481e2 | 2015-10-06 19:59:39 | [diff] [blame^] | 20 | "attachment_broker_unprivileged_mac.cc", |
| 21 | "attachment_broker_unprivileged_mac.h", |
erikchen | 484c0084 | 2015-07-28 23:25:44 | [diff] [blame] | 22 | "attachment_broker_unprivileged_win.cc", |
| 23 | "attachment_broker_unprivileged_win.h", |
erikchen | 151b2f9 | 2015-06-16 20:20:51 | [diff] [blame] | 24 | "brokerable_attachment.cc", |
| 25 | "brokerable_attachment.h", |
erikchen | a5085cda | 2015-09-15 17:26:27 | [diff] [blame] | 26 | "brokerable_attachment_win.cc", |
erikchen | eece6c3 | 2015-07-07 22:13:11 | [diff] [blame] | 27 | "handle_attachment_win.cc", |
erikchen | 151b2f9 | 2015-06-16 20:20:51 | [diff] [blame] | 28 | "handle_attachment_win.h", |
erikchen | 959039d | 2015-08-11 21:17:47 | [diff] [blame] | 29 | "handle_win.cc", |
| 30 | "handle_win.h", |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 31 | "ipc_channel.cc", |
| 32 | "ipc_channel.h", |
scottmg | 7c7296f4 | 2015-02-28 02:23:09 | [diff] [blame] | 33 | "ipc_channel_common.cc", |
[email protected] | 6486088 | 2014-08-04 23:44:17 | [diff] [blame] | 34 | "ipc_channel_factory.cc", |
| 35 | "ipc_channel_factory.h", |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 36 | "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", |
erikchen | a09b9be7 | 2015-08-10 19:22:33 | [diff] [blame] | 48 | "ipc_endpoint.cc", |
| 49 | "ipc_endpoint.h", |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 50 | "ipc_export.h", |
erikchen | eece6c3 | 2015-07-07 22:13:11 | [diff] [blame] | 51 | "ipc_handle_win.cc", |
| 52 | "ipc_handle_win.h", |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 53 | "ipc_listener.h", |
| 54 | "ipc_logging.cc", |
| 55 | "ipc_logging.h", |
| 56 | "ipc_message.cc", |
| 57 | "ipc_message.h", |
morrita | 98b7aaa | 2015-01-26 22:42:54 | [diff] [blame] | 58 | "ipc_message_attachment.cc", |
| 59 | "ipc_message_attachment.h", |
morrita | 4b5c28e2 | 2015-01-14 21:17:06 | [diff] [blame] | 60 | "ipc_message_attachment_set.cc", |
| 61 | "ipc_message_attachment_set.h", |
erikchen | eece6c3 | 2015-07-07 22:13:11 | [diff] [blame] | 62 | "ipc_message_generator.cc", |
| 63 | "ipc_message_generator.h", |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 64 | "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", |
morrita | 1aa788c | 2015-01-31 05:45:42 | [diff] [blame] | 71 | "ipc_platform_file_attachment_posix.cc", |
| 72 | "ipc_platform_file_attachment_posix.h", |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 73 | "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", |
erikchen | 1c1e665 | 2015-10-01 18:51:32 | [diff] [blame] | 82 | "mach_port_attachment_mac.cc", |
| 83 | "mach_port_attachment_mac.h", |
| 84 | "mach_port_mac.cc", |
| 85 | "mach_port_mac.h", |
[email protected] | 7412204 | 2014-04-25 00:07:30 | [diff] [blame] | 86 | "message_filter.cc", |
| 87 | "message_filter.h", |
| 88 | "message_filter_router.cc", |
| 89 | "message_filter_router.h", |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 90 | "param_traits_log_macros.h", |
| 91 | "param_traits_macros.h", |
| 92 | "param_traits_read_macros.h", |
| 93 | "param_traits_write_macros.h", |
erikchen | 87351da | 2015-09-15 19:11:09 | [diff] [blame] | 94 | "placeholder_brokerable_attachment.cc", |
| 95 | "placeholder_brokerable_attachment.h", |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 96 | "struct_constructor_macros.h", |
| 97 | "struct_destructor_macros.h", |
| 98 | "unix_domain_socket_util.cc", |
| 99 | "unix_domain_socket_util.h", |
| 100 | ] |
| 101 | |
dpranke | 6065cf7 | 2015-02-26 03:30:58 | [diff] [blame] | 102 | 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] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 109 | sources -= [ |
| 110 | "ipc_channel_nacl.cc", |
| 111 | "ipc_channel_nacl.h", |
| 112 | ] |
[email protected] | 517d528 | 2014-04-02 17:03:30 | [diff] [blame] | 113 | } |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 114 | |
| 115 | if (is_win || is_ios) { |
scottmg | 34fb7e5 | 2014-12-03 23:27:24 | [diff] [blame] | 116 | sources -= [ "unix_domain_socket_util.cc" ] |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 117 | } |
| 118 | |
| 119 | defines = [ "IPC_IMPLEMENTATION" ] |
| 120 | |
| 121 | deps = [ |
| 122 | "//base", |
scottmg | 34fb7e5 | 2014-12-03 23:27:24 | [diff] [blame] | 123 | |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 124 | # TODO(viettrungluu): Needed for base/lazy_instance.h, which is suspect. |
| 125 | "//base/third_party/dynamic_annotations", |
| 126 | ] |
Sergey Ulanov | 384a29c9 | 2015-09-14 17:11:35 | [diff] [blame] | 127 | |
| 128 | if (is_win) { |
| 129 | # On windows HandleAttachmentWin needs to generate random IDs. |
| 130 | deps += [ "//crypto" ] |
| 131 | } |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 132 | } |
| 133 | |
dpranke | 6065cf7 | 2015-02-26 03:30:58 | [diff] [blame] | 134 | # TODO(GYP): crbug.com/360936. Get this to build and run on Android. |
[email protected] | 5a8d516 | 2014-04-12 01:19:16 | [diff] [blame] | 135 | if (!is_android) { |
dpranke | 177c1e2 | 2015-07-22 23:07:43 | [diff] [blame] | 136 | group("ipc_tests_run") { |
| 137 | testonly = true |
| 138 | deps = [ |
| 139 | ":ipc_tests", |
| 140 | ] |
| 141 | } |
| 142 | |
[email protected] | 5a8d516 | 2014-04-12 01:19:16 | [diff] [blame] | 143 | test("ipc_tests") { |
| 144 | sources = [ |
erikchen | b3481e2 | 2015-10-06 19:59:39 | [diff] [blame^] | 145 | "attachment_broker_privileged_mac_unittest.cc", |
erikchen | c04ab34c | 2015-07-27 20:28:20 | [diff] [blame] | 146 | "attachment_broker_privileged_win_unittest.cc", |
erikchen | 484c0084 | 2015-07-28 23:25:44 | [diff] [blame] | 147 | "attachment_broker_unprivileged_win_unittest.cc", |
[email protected] | 5a8d516 | 2014-04-12 01:19:16 | [diff] [blame] | 148 | "ipc_channel_posix_unittest.cc", |
brettw | 298955fc | 2015-08-25 23:47:52 | [diff] [blame] | 149 | "ipc_channel_proxy_unittest.cc", |
erikchen | de9412b8 | 2015-07-27 18:26:14 | [diff] [blame] | 150 | "ipc_channel_reader_unittest.cc", |
[email protected] | 5a8d516 | 2014-04-12 01:19:16 | [diff] [blame] | 151 | "ipc_channel_unittest.cc", |
| 152 | "ipc_fuzzing_tests.cc", |
morrita | 4b5c28e2 | 2015-01-14 21:17:06 | [diff] [blame] | 153 | "ipc_message_attachment_set_posix_unittest.cc", |
[email protected] | 5a8d516 | 2014-04-12 01:19:16 | [diff] [blame] | 154 | "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", |
erikchen | 98daa73 | 2015-09-25 18:30:03 | [diff] [blame] | 160 | "ipc_test_message_generator.cc", |
| 161 | "ipc_test_message_generator.h", |
| 162 | "ipc_test_messages.h", |
[email protected] | 5a8d516 | 2014-04-12 01:19:16 | [diff] [blame] | 163 | "sync_socket_unittest.cc", |
| 164 | "unix_domain_socket_util_unittest.cc", |
| 165 | ] |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 166 | |
[email protected] | 5a8d516 | 2014-04-12 01:19:16 | [diff] [blame] | 167 | 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] | 2fa89ef | 2014-05-07 18:45:59 | [diff] [blame] | 178 | # if (use_allocator!="none") { |
[email protected] | 5a8d516 | 2014-04-12 01:19:16 | [diff] [blame] | 179 | # deps += "/base/allocator" |
| 180 | # } |
| 181 | #} |
| 182 | |
| 183 | deps = [ |
| 184 | ":ipc", |
[email protected] | df82b4f5 | 2014-07-23 20:21:50 | [diff] [blame] | 185 | ":test_support", |
[email protected] | 5a8d516 | 2014-04-12 01:19:16 | [diff] [blame] | 186 | "//base", |
| 187 | "//base:i18n", |
| 188 | "//base/test:run_all_unittests", |
| 189 | "//base/test:test_support", |
Sergey Ulanov | 384a29c9 | 2015-09-14 17:11:35 | [diff] [blame] | 190 | "//crypto", |
[email protected] | 5a8d516 | 2014-04-12 01:19:16 | [diff] [blame] | 191 | "//testing/gtest", |
| 192 | ] |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 193 | } |
[email protected] | 517d528 | 2014-04-02 17:03:30 | [diff] [blame] | 194 | |
[email protected] | 5a8d516 | 2014-04-12 01:19:16 | [diff] [blame] | 195 | test("ipc_perftests") { |
| 196 | sources = [ |
| 197 | "ipc_perftests.cc", |
[email protected] | 5a8d516 | 2014-04-12 01:19:16 | [diff] [blame] | 198 | ] |
[email protected] | 517d528 | 2014-04-02 17:03:30 | [diff] [blame] | 199 | |
[email protected] | 5a8d516 | 2014-04-12 01:19:16 | [diff] [blame] | 200 | # 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] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 204 | |
[email protected] | 5a8d516 | 2014-04-12 01:19:16 | [diff] [blame] | 205 | # TODO(brettw) hook up tcmalloc to this target. |
| 206 | #if (is_posix && !is_mac && !is_android) { |
[email protected] | 2fa89ef | 2014-05-07 18:45:59 | [diff] [blame] | 207 | # if (use_allocator!="none") { |
[email protected] | 5a8d516 | 2014-04-12 01:19:16 | [diff] [blame] | 208 | # deps += "//base/allocator" |
| 209 | # } |
| 210 | #} |
[email protected] | 5a8d516 | 2014-04-12 01:19:16 | [diff] [blame] | 211 | deps = [ |
| 212 | ":ipc", |
[email protected] | df82b4f5 | 2014-07-23 20:21:50 | [diff] [blame] | 213 | ":test_support", |
[email protected] | 5a8d516 | 2014-04-12 01:19:16 | [diff] [blame] | 214 | "//base", |
| 215 | "//base:i18n", |
| 216 | "//base/test:test_support", |
| 217 | "//base/test:test_support_perf", |
| 218 | "//testing/gtest", |
| 219 | ] |
| 220 | } |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 221 | } |
| 222 | |
brettw | 298955fc | 2015-08-25 23:47:52 | [diff] [blame] | 223 | source_set("test_support") { |
Brett Wilson | 0c8745a | 2014-09-08 22:59:49 | [diff] [blame] | 224 | testonly = true |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 225 | sources = [ |
| 226 | "ipc_multiprocess_test.cc", |
| 227 | "ipc_multiprocess_test.h", |
morrita | 373af03b | 2014-09-09 19:35:24 | [diff] [blame] | 228 | "ipc_perftest_support.cc", |
| 229 | "ipc_perftest_support.h", |
brettw | 013b729f | 2015-01-12 08:03:47 | [diff] [blame] | 230 | "ipc_security_test_util.cc", |
| 231 | "ipc_security_test_util.h", |
[email protected] | 6486088 | 2014-08-04 23:44:17 | [diff] [blame] | 232 | "ipc_test_base.cc", |
| 233 | "ipc_test_base.h", |
[email protected] | 6486088 | 2014-08-04 23:44:17 | [diff] [blame] | 234 | "ipc_test_channel_listener.cc", |
brettw | 013b729f | 2015-01-12 08:03:47 | [diff] [blame] | 235 | "ipc_test_channel_listener.h", |
| 236 | "ipc_test_sink.cc", |
| 237 | "ipc_test_sink.h", |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 238 | ] |
| 239 | deps = [ |
| 240 | ":ipc", |
| 241 | "//base", |
brettw | e75311d | 2015-02-17 23:56:46 | [diff] [blame] | 242 | "//base/test:test_support", |
[email protected] | 23e197d | 2013-12-31 12:14:01 | [diff] [blame] | 243 | "//testing/gtest", |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 244 | ] |
| 245 | } |