[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 | c04ab34c | 2015-07-27 20:28:20 | [diff] [blame] | 14 | "attachment_broker_privileged_win.cc", |
| 15 | "attachment_broker_privileged_win.h", |
erikchen | 484c0084 | 2015-07-28 23:25:44 | [diff] [blame] | 16 | "attachment_broker_unprivileged.cc", |
| 17 | "attachment_broker_unprivileged.h", |
| 18 | "attachment_broker_unprivileged_win.cc", |
| 19 | "attachment_broker_unprivileged_win.h", |
erikchen | 151b2f9 | 2015-06-16 20:20:51 | [diff] [blame] | 20 | "brokerable_attachment.cc", |
| 21 | "brokerable_attachment.h", |
erikchen | eece6c3 | 2015-07-07 22:13:11 | [diff] [blame] | 22 | "handle_attachment_win.cc", |
erikchen | 151b2f9 | 2015-06-16 20:20:51 | [diff] [blame] | 23 | "handle_attachment_win.h", |
erikchen | 959039d | 2015-08-11 21:17:47 | [diff] [blame^] | 24 | "handle_win.cc", |
| 25 | "handle_win.h", |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 26 | "ipc_channel.cc", |
| 27 | "ipc_channel.h", |
scottmg | 7c7296f4 | 2015-02-28 02:23:09 | [diff] [blame] | 28 | "ipc_channel_common.cc", |
[email protected] | 6486088 | 2014-08-04 23:44:17 | [diff] [blame] | 29 | "ipc_channel_factory.cc", |
| 30 | "ipc_channel_factory.h", |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 31 | "ipc_channel_handle.h", |
| 32 | "ipc_channel_nacl.cc", |
| 33 | "ipc_channel_nacl.h", |
| 34 | "ipc_channel_posix.cc", |
| 35 | "ipc_channel_posix.h", |
| 36 | "ipc_channel_proxy.cc", |
| 37 | "ipc_channel_proxy.h", |
| 38 | "ipc_channel_reader.cc", |
| 39 | "ipc_channel_reader.h", |
| 40 | "ipc_channel_win.cc", |
| 41 | "ipc_channel_win.h", |
| 42 | "ipc_descriptors.h", |
erikchen | a09b9be7 | 2015-08-10 19:22:33 | [diff] [blame] | 43 | "ipc_endpoint.cc", |
| 44 | "ipc_endpoint.h", |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 45 | "ipc_export.h", |
erikchen | eece6c3 | 2015-07-07 22:13:11 | [diff] [blame] | 46 | "ipc_handle_win.cc", |
| 47 | "ipc_handle_win.h", |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 48 | "ipc_listener.h", |
| 49 | "ipc_logging.cc", |
| 50 | "ipc_logging.h", |
| 51 | "ipc_message.cc", |
| 52 | "ipc_message.h", |
morrita | 98b7aaa | 2015-01-26 22:42:54 | [diff] [blame] | 53 | "ipc_message_attachment.cc", |
| 54 | "ipc_message_attachment.h", |
morrita | 4b5c28e2 | 2015-01-14 21:17:06 | [diff] [blame] | 55 | "ipc_message_attachment_set.cc", |
| 56 | "ipc_message_attachment_set.h", |
erikchen | eece6c3 | 2015-07-07 22:13:11 | [diff] [blame] | 57 | "ipc_message_generator.cc", |
| 58 | "ipc_message_generator.h", |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 59 | "ipc_message_macros.h", |
| 60 | "ipc_message_start.h", |
| 61 | "ipc_message_utils.cc", |
| 62 | "ipc_message_utils.h", |
| 63 | "ipc_param_traits.h", |
| 64 | "ipc_platform_file.cc", |
| 65 | "ipc_platform_file.h", |
morrita | 1aa788c | 2015-01-31 05:45:42 | [diff] [blame] | 66 | "ipc_platform_file_attachment_posix.cc", |
| 67 | "ipc_platform_file_attachment_posix.h", |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 68 | "ipc_sender.h", |
| 69 | "ipc_switches.cc", |
| 70 | "ipc_switches.h", |
| 71 | "ipc_sync_channel.cc", |
| 72 | "ipc_sync_channel.h", |
| 73 | "ipc_sync_message.cc", |
| 74 | "ipc_sync_message.h", |
| 75 | "ipc_sync_message_filter.cc", |
| 76 | "ipc_sync_message_filter.h", |
[email protected] | 7412204 | 2014-04-25 00:07:30 | [diff] [blame] | 77 | "message_filter.cc", |
| 78 | "message_filter.h", |
| 79 | "message_filter_router.cc", |
| 80 | "message_filter_router.h", |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 81 | "param_traits_log_macros.h", |
| 82 | "param_traits_macros.h", |
| 83 | "param_traits_read_macros.h", |
| 84 | "param_traits_write_macros.h", |
| 85 | "struct_constructor_macros.h", |
| 86 | "struct_destructor_macros.h", |
| 87 | "unix_domain_socket_util.cc", |
| 88 | "unix_domain_socket_util.h", |
| 89 | ] |
| 90 | |
dpranke | 6065cf7 | 2015-02-26 03:30:58 | [diff] [blame] | 91 | if (is_nacl) { |
| 92 | sources -= [ |
| 93 | "ipc_channel.cc", |
| 94 | "ipc_channel_posix.cc", |
| 95 | "unix_domain_socket_util.cc", |
| 96 | ] |
| 97 | } else { |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 98 | sources -= [ |
| 99 | "ipc_channel_nacl.cc", |
| 100 | "ipc_channel_nacl.h", |
| 101 | ] |
[email protected] | 517d528 | 2014-04-02 17:03:30 | [diff] [blame] | 102 | } |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 103 | |
| 104 | if (is_win || is_ios) { |
scottmg | 34fb7e5 | 2014-12-03 23:27:24 | [diff] [blame] | 105 | sources -= [ "unix_domain_socket_util.cc" ] |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 106 | } |
| 107 | |
| 108 | defines = [ "IPC_IMPLEMENTATION" ] |
| 109 | |
| 110 | deps = [ |
| 111 | "//base", |
scottmg | 34fb7e5 | 2014-12-03 23:27:24 | [diff] [blame] | 112 | |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 113 | # TODO(viettrungluu): Needed for base/lazy_instance.h, which is suspect. |
| 114 | "//base/third_party/dynamic_annotations", |
erikchen | eece6c3 | 2015-07-07 22:13:11 | [diff] [blame] | 115 | "//crypto:crypto", |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 116 | ] |
| 117 | } |
| 118 | |
dpranke | 6065cf7 | 2015-02-26 03:30:58 | [diff] [blame] | 119 | # TODO(GYP): crbug.com/360936. Get this to build and run on Android. |
[email protected] | 5a8d516 | 2014-04-12 01:19:16 | [diff] [blame] | 120 | if (!is_android) { |
dpranke | 177c1e2 | 2015-07-22 23:07:43 | [diff] [blame] | 121 | group("ipc_tests_run") { |
| 122 | testonly = true |
| 123 | deps = [ |
| 124 | ":ipc_tests", |
| 125 | ] |
| 126 | } |
| 127 | |
[email protected] | 5a8d516 | 2014-04-12 01:19:16 | [diff] [blame] | 128 | test("ipc_tests") { |
| 129 | sources = [ |
erikchen | c04ab34c | 2015-07-27 20:28:20 | [diff] [blame] | 130 | "attachment_broker_privileged_win_unittest.cc", |
erikchen | 484c0084 | 2015-07-28 23:25:44 | [diff] [blame] | 131 | "attachment_broker_unprivileged_win_unittest.cc", |
[email protected] | 5a8d516 | 2014-04-12 01:19:16 | [diff] [blame] | 132 | "ipc_channel_posix_unittest.cc", |
erikchen | de9412b8 | 2015-07-27 18:26:14 | [diff] [blame] | 133 | "ipc_channel_reader_unittest.cc", |
[email protected] | 5a8d516 | 2014-04-12 01:19:16 | [diff] [blame] | 134 | "ipc_channel_unittest.cc", |
| 135 | "ipc_fuzzing_tests.cc", |
morrita | 4b5c28e2 | 2015-01-14 21:17:06 | [diff] [blame] | 136 | "ipc_message_attachment_set_posix_unittest.cc", |
[email protected] | 5a8d516 | 2014-04-12 01:19:16 | [diff] [blame] | 137 | "ipc_message_unittest.cc", |
| 138 | "ipc_message_utils_unittest.cc", |
| 139 | "ipc_send_fds_test.cc", |
| 140 | "ipc_sync_channel_unittest.cc", |
| 141 | "ipc_sync_message_unittest.cc", |
| 142 | "ipc_sync_message_unittest.h", |
[email protected] | 5a8d516 | 2014-04-12 01:19:16 | [diff] [blame] | 143 | "sync_socket_unittest.cc", |
| 144 | "unix_domain_socket_util_unittest.cc", |
| 145 | ] |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 146 | |
[email protected] | 5a8d516 | 2014-04-12 01:19:16 | [diff] [blame] | 147 | if (is_win || is_ios) { |
| 148 | sources -= [ "unix_domain_socket_util_unittest.cc" ] |
| 149 | } |
| 150 | |
| 151 | # TODO(brettw) hook up Android testing. |
| 152 | #if (is_android && gtest_target_type == "shared_library") { |
| 153 | # deps += "/testing/android/native_test.gyp:native_testNative_code" |
| 154 | #} |
| 155 | |
| 156 | # TODO(brettw) hook up tcmalloc to this target. |
| 157 | #if (is_posix && !is_mac && !is_android) { |
[email protected] | 2fa89ef | 2014-05-07 18:45:59 | [diff] [blame] | 158 | # if (use_allocator!="none") { |
[email protected] | 5a8d516 | 2014-04-12 01:19:16 | [diff] [blame] | 159 | # deps += "/base/allocator" |
| 160 | # } |
| 161 | #} |
| 162 | |
| 163 | deps = [ |
| 164 | ":ipc", |
[email protected] | df82b4f5 | 2014-07-23 20:21:50 | [diff] [blame] | 165 | ":test_support", |
[email protected] | 5a8d516 | 2014-04-12 01:19:16 | [diff] [blame] | 166 | "//base", |
| 167 | "//base:i18n", |
| 168 | "//base/test:run_all_unittests", |
| 169 | "//base/test:test_support", |
| 170 | "//testing/gtest", |
| 171 | ] |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 172 | } |
[email protected] | 517d528 | 2014-04-02 17:03:30 | [diff] [blame] | 173 | |
[email protected] | 5a8d516 | 2014-04-12 01:19:16 | [diff] [blame] | 174 | test("ipc_perftests") { |
| 175 | sources = [ |
| 176 | "ipc_perftests.cc", |
[email protected] | 5a8d516 | 2014-04-12 01:19:16 | [diff] [blame] | 177 | ] |
[email protected] | 517d528 | 2014-04-02 17:03:30 | [diff] [blame] | 178 | |
[email protected] | 5a8d516 | 2014-04-12 01:19:16 | [diff] [blame] | 179 | # TODO(brettw) hook up Android testing. |
| 180 | #if (is_android && gtest_target_type == "shared_library") { |
| 181 | # deps += "/testing/android/native_test.gyp:native_testNative_code" |
| 182 | #} |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 183 | |
[email protected] | 5a8d516 | 2014-04-12 01:19:16 | [diff] [blame] | 184 | # TODO(brettw) hook up tcmalloc to this target. |
| 185 | #if (is_posix && !is_mac && !is_android) { |
[email protected] | 2fa89ef | 2014-05-07 18:45:59 | [diff] [blame] | 186 | # if (use_allocator!="none") { |
[email protected] | 5a8d516 | 2014-04-12 01:19:16 | [diff] [blame] | 187 | # deps += "//base/allocator" |
| 188 | # } |
| 189 | #} |
[email protected] | 5a8d516 | 2014-04-12 01:19:16 | [diff] [blame] | 190 | deps = [ |
| 191 | ":ipc", |
[email protected] | df82b4f5 | 2014-07-23 20:21:50 | [diff] [blame] | 192 | ":test_support", |
[email protected] | 5a8d516 | 2014-04-12 01:19:16 | [diff] [blame] | 193 | "//base", |
| 194 | "//base:i18n", |
| 195 | "//base/test:test_support", |
| 196 | "//base/test:test_support_perf", |
| 197 | "//testing/gtest", |
| 198 | ] |
| 199 | } |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 200 | } |
| 201 | |
[email protected] | df82b4f5 | 2014-07-23 20:21:50 | [diff] [blame] | 202 | static_library("test_support") { |
Brett Wilson | 0c8745a | 2014-09-08 22:59:49 | [diff] [blame] | 203 | testonly = true |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 204 | sources = [ |
| 205 | "ipc_multiprocess_test.cc", |
| 206 | "ipc_multiprocess_test.h", |
morrita | 373af03b | 2014-09-09 19:35:24 | [diff] [blame] | 207 | "ipc_perftest_support.cc", |
| 208 | "ipc_perftest_support.h", |
brettw | 013b729f | 2015-01-12 08:03:47 | [diff] [blame] | 209 | "ipc_security_test_util.cc", |
| 210 | "ipc_security_test_util.h", |
[email protected] | 6486088 | 2014-08-04 23:44:17 | [diff] [blame] | 211 | "ipc_test_base.cc", |
| 212 | "ipc_test_base.h", |
[email protected] | 6486088 | 2014-08-04 23:44:17 | [diff] [blame] | 213 | "ipc_test_channel_listener.cc", |
brettw | 013b729f | 2015-01-12 08:03:47 | [diff] [blame] | 214 | "ipc_test_channel_listener.h", |
| 215 | "ipc_test_sink.cc", |
| 216 | "ipc_test_sink.h", |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 217 | ] |
| 218 | deps = [ |
| 219 | ":ipc", |
| 220 | "//base", |
brettw | e75311d | 2015-02-17 23:56:46 | [diff] [blame] | 221 | "//base/test:test_support", |
[email protected] | 23e197d | 2013-12-31 12:14:01 | [diff] [blame] | 222 | "//testing/gtest", |
[email protected] | 7603bbd1 | 2013-08-13 17:33:37 | [diff] [blame] | 223 | ] |
| 224 | } |