• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
5component("ipc") {
6  sources = [
7    "file_descriptor_set_posix.cc",
8    "file_descriptor_set_posix.h",
9    "ipc_channel.cc",
10    "ipc_channel.h",
11    "ipc_channel_factory.cc",
12    "ipc_channel_factory.h",
13    "ipc_channel_common.cc",
14    "ipc_channel_handle.h",
15    "ipc_channel_nacl.cc",
16    "ipc_channel_nacl.h",
17    "ipc_channel_posix.cc",
18    "ipc_channel_posix.h",
19    "ipc_channel_proxy.cc",
20    "ipc_channel_proxy.h",
21    "ipc_channel_reader.cc",
22    "ipc_channel_reader.h",
23    "ipc_channel_win.cc",
24    "ipc_channel_win.h",
25    "ipc_descriptors.h",
26    "ipc_export.h",
27    "ipc_forwarding_message_filter.cc",
28    "ipc_forwarding_message_filter.h",
29    "ipc_listener.h",
30    "ipc_logging.cc",
31    "ipc_logging.h",
32    "ipc_message.cc",
33    "ipc_message.h",
34    "ipc_message_macros.h",
35    "ipc_message_start.h",
36    "ipc_message_utils.cc",
37    "ipc_message_utils.h",
38    "ipc_param_traits.h",
39    "ipc_platform_file.cc",
40    "ipc_platform_file.h",
41    "ipc_sender.h",
42    "ipc_switches.cc",
43    "ipc_switches.h",
44    "ipc_sync_channel.cc",
45    "ipc_sync_channel.h",
46    "ipc_sync_message.cc",
47    "ipc_sync_message.h",
48    "ipc_sync_message_filter.cc",
49    "ipc_sync_message_filter.h",
50    "message_filter.cc",
51    "message_filter.h",
52    "message_filter_router.cc",
53    "message_filter_router.h",
54    "param_traits_log_macros.h",
55    "param_traits_macros.h",
56    "param_traits_read_macros.h",
57    "param_traits_write_macros.h",
58    "struct_constructor_macros.h",
59    "struct_destructor_macros.h",
60    "unix_domain_socket_util.cc",
61    "unix_domain_socket_util.h",
62  ]
63
64  if (!is_nacl) {
65    sources -= [
66      "ipc_channel_nacl.cc",
67      "ipc_channel_nacl.h",
68    ]
69  }
70
71  if (is_win || is_ios) {
72    sources -= [
73      "unix_domain_socket_util.cc",
74    ]
75  }
76
77  defines = [ "IPC_IMPLEMENTATION" ]
78
79  deps = [
80    "//base",
81    # TODO(viettrungluu): Needed for base/lazy_instance.h, which is suspect.
82    "//base/third_party/dynamic_annotations",
83  ]
84}
85
86# TODO(dpranke): crbug.com/360936. Get this to build and run on Android.
87if (!is_android) {
88  test("ipc_tests") {
89    sources = [
90      "file_descriptor_set_posix_unittest.cc",
91      "ipc_channel_posix_unittest.cc",
92      "ipc_channel_unittest.cc",
93      "ipc_fuzzing_tests.cc",
94      "ipc_message_unittest.cc",
95      "ipc_message_utils_unittest.cc",
96      "ipc_send_fds_test.cc",
97      "ipc_sync_channel_unittest.cc",
98      "ipc_sync_message_unittest.cc",
99      "ipc_sync_message_unittest.h",
100      "sync_socket_unittest.cc",
101      "unix_domain_socket_util_unittest.cc",
102    ]
103
104    if (is_win || is_ios) {
105      sources -= [ "unix_domain_socket_util_unittest.cc" ]
106    }
107
108    # TODO(brettw) hook up Android testing.
109    #if (is_android && gtest_target_type == "shared_library") {
110    #  deps += "/testing/android/native_test.gyp:native_testNative_code"
111    #}
112
113    # TODO(brettw) hook up tcmalloc to this target.
114    #if (is_posix && !is_mac && !is_android) {
115    #  if (use_allocator!="none") {
116    #    deps += "/base/allocator"
117    #  }
118    #}
119
120    deps = [
121      ":ipc",
122      ":test_support",
123      "//base",
124      "//base:i18n",
125      "//base/test:run_all_unittests",
126      "//base/test:test_support",
127      "//testing/gtest",
128    ]
129  }
130
131  test("ipc_perftests") {
132    sources = [
133      "ipc_perftests.cc",
134    ]
135
136    # TODO(brettw) hook up Android testing.
137    #if (is_android && gtest_target_type == "shared_library") {
138    #  deps += "/testing/android/native_test.gyp:native_testNative_code"
139    #}
140
141    # TODO(brettw) hook up tcmalloc to this target.
142    #if (is_posix && !is_mac && !is_android) {
143    #  if (use_allocator!="none") {
144    #    deps += "//base/allocator"
145    #  }
146    #}
147
148    deps = [
149      ":ipc",
150      ":test_support",
151      "//base",
152      "//base:i18n",
153      "//base/test:test_support",
154      "//base/test:test_support_perf",
155      "//testing/gtest",
156    ]
157  }
158}
159
160static_library("test_support") {
161  testonly = true
162  sources = [
163    "ipc_multiprocess_test.cc",
164    "ipc_multiprocess_test.h",
165    "ipc_perftest_support.cc",
166    "ipc_perftest_support.h",
167    "ipc_test_sink.cc",
168    "ipc_test_sink.h",
169    "ipc_test_base.cc",
170    "ipc_test_base.h",
171    "ipc_test_channel_listener.h",
172    "ipc_test_channel_listener.cc",
173  ]
174  deps = [
175    ":ipc",
176    "//base",
177    "//testing/gtest",
178  ]
179}
180
181