blob: 75d0c6261fa9c5cc7848500c4506592e8412fecd [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",
erikchenc04ab34c2015-07-27 20:28:2012 "attachment_broker_privileged_win.cc",
13 "attachment_broker_privileged_win.h",
erikchen151b2f92015-06-16 20:20:5114 "attachment_broker_win.cc",
15 "attachment_broker_win.h",
16 "brokerable_attachment.cc",
17 "brokerable_attachment.h",
erikcheneece6c32015-07-07 22:13:1118 "handle_attachment_win.cc",
erikchen151b2f92015-06-16 20:20:5119 "handle_attachment_win.h",
[email protected]7603bbd12013-08-13 17:33:3720 "ipc_channel.cc",
21 "ipc_channel.h",
scottmg7c7296f42015-02-28 02:23:0922 "ipc_channel_common.cc",
[email protected]64860882014-08-04 23:44:1723 "ipc_channel_factory.cc",
24 "ipc_channel_factory.h",
[email protected]7603bbd12013-08-13 17:33:3725 "ipc_channel_handle.h",
26 "ipc_channel_nacl.cc",
27 "ipc_channel_nacl.h",
28 "ipc_channel_posix.cc",
29 "ipc_channel_posix.h",
30 "ipc_channel_proxy.cc",
31 "ipc_channel_proxy.h",
32 "ipc_channel_reader.cc",
33 "ipc_channel_reader.h",
34 "ipc_channel_win.cc",
35 "ipc_channel_win.h",
36 "ipc_descriptors.h",
37 "ipc_export.h",
erikcheneece6c32015-07-07 22:13:1138 "ipc_handle_win.cc",
39 "ipc_handle_win.h",
[email protected]7603bbd12013-08-13 17:33:3740 "ipc_listener.h",
41 "ipc_logging.cc",
42 "ipc_logging.h",
43 "ipc_message.cc",
44 "ipc_message.h",
morrita98b7aaa2015-01-26 22:42:5445 "ipc_message_attachment.cc",
46 "ipc_message_attachment.h",
morrita4b5c28e22015-01-14 21:17:0647 "ipc_message_attachment_set.cc",
48 "ipc_message_attachment_set.h",
erikcheneece6c32015-07-07 22:13:1149 "ipc_message_generator.cc",
50 "ipc_message_generator.h",
[email protected]7603bbd12013-08-13 17:33:3751 "ipc_message_macros.h",
52 "ipc_message_start.h",
53 "ipc_message_utils.cc",
54 "ipc_message_utils.h",
55 "ipc_param_traits.h",
56 "ipc_platform_file.cc",
57 "ipc_platform_file.h",
morrita1aa788c2015-01-31 05:45:4258 "ipc_platform_file_attachment_posix.cc",
59 "ipc_platform_file_attachment_posix.h",
[email protected]7603bbd12013-08-13 17:33:3760 "ipc_sender.h",
61 "ipc_switches.cc",
62 "ipc_switches.h",
63 "ipc_sync_channel.cc",
64 "ipc_sync_channel.h",
65 "ipc_sync_message.cc",
66 "ipc_sync_message.h",
67 "ipc_sync_message_filter.cc",
68 "ipc_sync_message_filter.h",
[email protected]74122042014-04-25 00:07:3069 "message_filter.cc",
70 "message_filter.h",
71 "message_filter_router.cc",
72 "message_filter_router.h",
[email protected]7603bbd12013-08-13 17:33:3773 "param_traits_log_macros.h",
74 "param_traits_macros.h",
75 "param_traits_read_macros.h",
76 "param_traits_write_macros.h",
77 "struct_constructor_macros.h",
78 "struct_destructor_macros.h",
79 "unix_domain_socket_util.cc",
80 "unix_domain_socket_util.h",
81 ]
82
dpranke6065cf72015-02-26 03:30:5883 if (is_nacl) {
84 sources -= [
85 "ipc_channel.cc",
86 "ipc_channel_posix.cc",
87 "unix_domain_socket_util.cc",
88 ]
89 } else {
[email protected]7603bbd12013-08-13 17:33:3790 sources -= [
91 "ipc_channel_nacl.cc",
92 "ipc_channel_nacl.h",
93 ]
[email protected]517d5282014-04-02 17:03:3094 }
[email protected]7603bbd12013-08-13 17:33:3795
96 if (is_win || is_ios) {
scottmg34fb7e52014-12-03 23:27:2497 sources -= [ "unix_domain_socket_util.cc" ]
[email protected]7603bbd12013-08-13 17:33:3798 }
99
100 defines = [ "IPC_IMPLEMENTATION" ]
101
102 deps = [
103 "//base",
scottmg34fb7e52014-12-03 23:27:24104
[email protected]7603bbd12013-08-13 17:33:37105 # TODO(viettrungluu): Needed for base/lazy_instance.h, which is suspect.
106 "//base/third_party/dynamic_annotations",
erikcheneece6c32015-07-07 22:13:11107 "//crypto:crypto",
[email protected]7603bbd12013-08-13 17:33:37108 ]
109}
110
dpranke6065cf72015-02-26 03:30:58111# TODO(GYP): crbug.com/360936. Get this to build and run on Android.
[email protected]5a8d5162014-04-12 01:19:16112if (!is_android) {
dpranke177c1e22015-07-22 23:07:43113 group("ipc_tests_run") {
114 testonly = true
115 deps = [
116 ":ipc_tests",
117 ]
118 }
119
[email protected]5a8d5162014-04-12 01:19:16120 test("ipc_tests") {
121 sources = [
erikchenc04ab34c2015-07-27 20:28:20122 "attachment_broker_privileged_win_unittest.cc",
erikchen7252aa362015-07-15 01:35:39123 "attachment_broker_win_unittest.cc",
[email protected]5a8d5162014-04-12 01:19:16124 "ipc_channel_posix_unittest.cc",
erikchende9412b82015-07-27 18:26:14125 "ipc_channel_reader_unittest.cc",
[email protected]5a8d5162014-04-12 01:19:16126 "ipc_channel_unittest.cc",
127 "ipc_fuzzing_tests.cc",
morrita4b5c28e22015-01-14 21:17:06128 "ipc_message_attachment_set_posix_unittest.cc",
[email protected]5a8d5162014-04-12 01:19:16129 "ipc_message_unittest.cc",
130 "ipc_message_utils_unittest.cc",
131 "ipc_send_fds_test.cc",
132 "ipc_sync_channel_unittest.cc",
133 "ipc_sync_message_unittest.cc",
134 "ipc_sync_message_unittest.h",
[email protected]5a8d5162014-04-12 01:19:16135 "sync_socket_unittest.cc",
136 "unix_domain_socket_util_unittest.cc",
137 ]
[email protected]7603bbd12013-08-13 17:33:37138
[email protected]5a8d5162014-04-12 01:19:16139 if (is_win || is_ios) {
140 sources -= [ "unix_domain_socket_util_unittest.cc" ]
141 }
142
143 # TODO(brettw) hook up Android testing.
144 #if (is_android && gtest_target_type == "shared_library") {
145 # deps += "/testing/android/native_test.gyp:native_testNative_code"
146 #}
147
148 # TODO(brettw) hook up tcmalloc to this target.
149 #if (is_posix && !is_mac && !is_android) {
[email protected]2fa89ef2014-05-07 18:45:59150 # if (use_allocator!="none") {
[email protected]5a8d5162014-04-12 01:19:16151 # deps += "/base/allocator"
152 # }
153 #}
154
155 deps = [
156 ":ipc",
[email protected]df82b4f52014-07-23 20:21:50157 ":test_support",
[email protected]5a8d5162014-04-12 01:19:16158 "//base",
159 "//base:i18n",
160 "//base/test:run_all_unittests",
161 "//base/test:test_support",
162 "//testing/gtest",
163 ]
[email protected]7603bbd12013-08-13 17:33:37164 }
[email protected]517d5282014-04-02 17:03:30165
[email protected]5a8d5162014-04-12 01:19:16166 test("ipc_perftests") {
167 sources = [
168 "ipc_perftests.cc",
[email protected]5a8d5162014-04-12 01:19:16169 ]
[email protected]517d5282014-04-02 17:03:30170
[email protected]5a8d5162014-04-12 01:19:16171 # 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 #}
[email protected]7603bbd12013-08-13 17:33:37175
[email protected]5a8d5162014-04-12 01:19:16176 # 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 #}
[email protected]5a8d5162014-04-12 01:19:16182 deps = [
183 ":ipc",
[email protected]df82b4f52014-07-23 20:21:50184 ":test_support",
[email protected]5a8d5162014-04-12 01:19:16185 "//base",
186 "//base:i18n",
187 "//base/test:test_support",
188 "//base/test:test_support_perf",
189 "//testing/gtest",
190 ]
191 }
[email protected]7603bbd12013-08-13 17:33:37192}
193
[email protected]df82b4f52014-07-23 20:21:50194static_library("test_support") {
Brett Wilson0c8745a2014-09-08 22:59:49195 testonly = true
[email protected]7603bbd12013-08-13 17:33:37196 sources = [
197 "ipc_multiprocess_test.cc",
198 "ipc_multiprocess_test.h",
morrita373af03b2014-09-09 19:35:24199 "ipc_perftest_support.cc",
200 "ipc_perftest_support.h",
brettw013b729f2015-01-12 08:03:47201 "ipc_security_test_util.cc",
202 "ipc_security_test_util.h",
[email protected]64860882014-08-04 23:44:17203 "ipc_test_base.cc",
204 "ipc_test_base.h",
[email protected]64860882014-08-04 23:44:17205 "ipc_test_channel_listener.cc",
brettw013b729f2015-01-12 08:03:47206 "ipc_test_channel_listener.h",
207 "ipc_test_sink.cc",
208 "ipc_test_sink.h",
[email protected]7603bbd12013-08-13 17:33:37209 ]
210 deps = [
211 ":ipc",
212 "//base",
brettwe75311d2015-02-17 23:56:46213 "//base/test:test_support",
[email protected]23e197d2013-12-31 12:14:01214 "//testing/gtest",
[email protected]7603bbd12013-08-13 17:33:37215 ]
216}