blob: 25d7e3f9adfd086ee0f8c833bdefe2542ba53dc0 [file] [log] [blame]
[email protected]abd4b682014-07-16 20:26:301# Copyright 2014 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
5static_library("gcm_driver") {
6 sources = [
7 "android/component_jni_registrar.cc",
8 "android/component_jni_registrar.h",
9 "default_gcm_app_handler.cc",
10 "default_gcm_app_handler.h",
fgorskid578c18b2014-09-24 23:40:1711 "gcm_account_mapper.cc",
12 "gcm_account_mapper.h",
jitendra.ks70c5b4c2015-08-19 18:53:3413 "gcm_account_tracker.cc",
14 "gcm_account_tracker.h",
satoruxea51ccc2015-02-16 10:14:2415 "gcm_activity.cc",
16 "gcm_activity.h",
[email protected]abd4b682014-07-16 20:26:3017 "gcm_app_handler.cc",
18 "gcm_app_handler.h",
jianli1235e51c2014-09-08 18:56:4119 "gcm_backoff_policy.cc",
20 "gcm_backoff_policy.h",
21 "gcm_channel_status_request.cc",
22 "gcm_channel_status_request.h",
jianli2dc910b02014-09-19 02:42:4623 "gcm_channel_status_syncer.cc",
24 "gcm_channel_status_syncer.h",
[email protected]abd4b682014-07-16 20:26:3025 "gcm_client.cc",
26 "gcm_client.h",
27 "gcm_client_factory.cc",
28 "gcm_client_factory.h",
29 "gcm_client_impl.cc",
30 "gcm_client_impl.h",
Brett Wilson83fd4242014-09-02 19:45:3331 "gcm_connection_observer.cc",
32 "gcm_connection_observer.h",
fgorski05d507c2014-09-10 17:28:1033 "gcm_delayed_task_controller.cc",
34 "gcm_delayed_task_controller.h",
jitendra.ksb1b7fee2015-09-22 17:42:5335 "gcm_desktop_utils.cc",
36 "gcm_desktop_utils.h",
[email protected]abd4b682014-07-16 20:26:3037 "gcm_driver.cc",
38 "gcm_driver.h",
39 "gcm_driver_android.cc",
40 "gcm_driver_android.h",
jitendra.ks75541942015-11-03 20:17:5141 "gcm_driver_constants.cc",
42 "gcm_driver_constants.h",
[email protected]abd4b682014-07-16 20:26:3043 "gcm_driver_desktop.cc",
44 "gcm_driver_desktop.h",
drogere89640c42015-09-15 18:57:4145 "gcm_internals_constants.cc",
46 "gcm_internals_constants.h",
droger08025a22015-11-16 10:58:5147 "gcm_internals_helper.cc",
48 "gcm_internals_helper.h",
jitendra.ks75541942015-11-03 20:17:5149 "gcm_profile_service.cc",
50 "gcm_profile_service.h",
peter1ed82982015-12-21 17:22:4951 "gcm_stats_recorder_android.cc",
52 "gcm_stats_recorder_android.h",
[email protected]abd4b682014-07-16 20:26:3053 "gcm_stats_recorder_impl.cc",
54 "gcm_stats_recorder_impl.h",
jianli7a0c9b62015-05-26 23:24:4755 "registration_info.cc",
56 "registration_info.h",
[email protected]abd4b682014-07-16 20:26:3057 "system_encryptor.cc",
58 "system_encryptor.h",
59 ]
60
brettwafa8f542016-08-24 05:16:2461 public_deps = [
[email protected]abd4b682014-07-16 20:26:3062 "//base",
tfarina1df94042015-07-22 17:28:4663 "//components/gcm_driver/common",
brettw2629c442015-11-26 02:42:1964 "//components/gcm_driver/crypto",
brettwafa8f542016-08-24 05:16:2465 "//components/gcm_driver/instance_id",
66 ]
67 deps = [
zea76342abf2016-11-01 17:26:0468 "//base:i18n",
brettwafa8f542016-08-24 05:16:2469 "//components/crx_file",
brettw2629c442015-11-26 02:42:1970 "//components/keyed_service/core",
[email protected]abd4b682014-07-16 20:26:3071 "//components/os_crypt",
brettw2629c442015-11-26 02:42:1972 "//components/pref_registry",
brettw9f7802a22016-01-30 06:40:1773 "//components/prefs",
brettw2629c442015-11-26 02:42:1974 "//components/signin/core/browser",
maxbogue455a57e32016-08-14 00:08:3275 "//components/sync",
brettw2629c442015-11-26 02:42:1976 "//components/version_info",
77 "//google_apis",
[email protected]abd4b682014-07-16 20:26:3078 "//google_apis/gcm",
79 "//net",
jitendra.ksb1b7fee2015-09-22 17:42:5380 "//url:url",
[email protected]abd4b682014-07-16 20:26:3081 ]
brettwafa8f542016-08-24 05:16:2482
83 # This target goes with these other deps and they can include headers from
84 # each other.
85 allow_circular_includes_from = [
86 "//components/gcm_driver/crypto",
87 "//components/gcm_driver/instance_id",
88 ]
[email protected]abd4b682014-07-16 20:26:3089
vchigrind853bed2015-01-13 08:31:1890 if (is_chromeos) {
91 deps += [ "//components/timers" ]
92 }
93
[email protected]abd4b682014-07-16 20:26:3094 if (is_android) {
95 sources -= [
fgorskid578c18b2014-09-24 23:40:1796 "gcm_account_mapper.cc",
97 "gcm_account_mapper.h",
jianli1235e51c2014-09-08 18:56:4198 "gcm_channel_status_request.cc",
99 "gcm_channel_status_request.h",
jianli2dc910b02014-09-19 02:42:46100 "gcm_channel_status_syncer.cc",
101 "gcm_channel_status_syncer.h",
[email protected]abd4b682014-07-16 20:26:30102 "gcm_client_factory.cc",
103 "gcm_client_factory.h",
104 "gcm_client_impl.cc",
105 "gcm_client_impl.h",
jitendra.ksb1b7fee2015-09-22 17:42:53106 "gcm_desktop_utils.cc",
107 "gcm_desktop_utils.h",
[email protected]abd4b682014-07-16 20:26:30108 "gcm_driver_desktop.cc",
109 "gcm_driver_desktop.h",
110 "gcm_stats_recorder_impl.cc",
111 "gcm_stats_recorder_impl.h",
112 ]
johnme627dc8c72016-08-19 21:49:39113 deps -= [
114 "//components/crx_file",
115 "//google_apis/gcm",
116 ]
cjhopman11a68cb2014-10-13 22:47:54117 deps += [ "android:jni_headers" ]
[email protected]abd4b682014-07-16 20:26:30118 }
119}
120
brettw77617612016-07-13 22:40:06121static_library("test_support") {
Brett Wilson0c8745a2014-09-08 22:59:49122 testonly = true
[email protected]abd4b682014-07-16 20:26:30123 sources = [
124 "fake_gcm_app_handler.cc",
125 "fake_gcm_app_handler.h",
126 "fake_gcm_client.cc",
127 "fake_gcm_client.h",
128 "fake_gcm_client_factory.cc",
129 "fake_gcm_client_factory.h",
130 "fake_gcm_driver.cc",
131 "fake_gcm_driver.h",
132 ]
133
brettweab63a52015-10-22 23:47:36134 public_deps = [
[email protected]abd4b682014-07-16 20:26:30135 ":gcm_driver",
brettweab63a52015-10-22 23:47:36136 ]
137 deps = [
[email protected]abd4b682014-07-16 20:26:30138 "//base",
peter245ad212015-07-09 11:30:59139 "//google_apis/gcm:test_support",
brettw2629c442015-11-26 02:42:19140 "//net",
[email protected]abd4b682014-07-16 20:26:30141 "//testing/gtest",
142 ]
143
144 if (is_android) {
145 sources -= [
146 "fake_gcm_client.cc",
147 "fake_gcm_client.h",
148 "fake_gcm_client_factory.cc",
149 "fake_gcm_client_factory.h",
150 ]
peter245ad212015-07-09 11:30:59151 deps -= [ "//google_apis/gcm:test_support" ]
[email protected]abd4b682014-07-16 20:26:30152 }
153}
peter245ad212015-07-09 11:30:59154
pkotwicz59272082015-10-29 19:29:14155source_set("unit_tests") {
156 testonly = true
157
158 sources = [
peter1ed82982015-12-21 17:22:49159 "gcm_account_mapper_unittest.cc",
pkotwicz59272082015-10-29 19:29:14160 "gcm_account_tracker_unittest.cc",
peter1ed82982015-12-21 17:22:49161 "gcm_channel_status_request_unittest.cc",
162 "gcm_client_impl_unittest.cc",
163 "gcm_delayed_task_controller_unittest.cc",
164 "gcm_driver_desktop_unittest.cc",
165 "gcm_stats_recorder_android_unittest.cc",
166 "gcm_stats_recorder_impl_unittest.cc",
pkotwicz59272082015-10-29 19:29:14167 ]
168
169 deps = [
170 ":gcm_driver",
171 ":test_support",
brettw2629c442015-11-26 02:42:19172 "//base",
brettw2629c442015-11-26 02:42:19173 "//base/test:test_support",
peteree284ba52016-02-01 11:53:28174 "//components/gcm_driver/crypto",
brettw9f7802a22016-01-30 06:40:17175 "//components/prefs:test_support",
Max Boguefef332d2016-07-28 22:09:09176 "//components/sync/protocol",
brettw2629c442015-11-26 02:42:19177 "//google_apis:test_support",
178 "//google_apis/gcm:test_support",
179 "//net:test_support",
pkotwicz59272082015-10-29 19:29:14180 "//testing/gtest",
181 "//third_party/protobuf:protobuf_lite",
182 ]
183
peter1ed82982015-12-21 17:22:49184 if (is_android) {
185 sources -= [
agrieve2f114fc2015-07-14 22:18:35186 "gcm_account_mapper_unittest.cc",
187 "gcm_channel_status_request_unittest.cc",
188 "gcm_client_impl_unittest.cc",
agrieve2f114fc2015-07-14 22:18:35189 "gcm_driver_desktop_unittest.cc",
190 "gcm_stats_recorder_impl_unittest.cc",
191 ]
agrieve2f114fc2015-07-14 22:18:35192 }
peter245ad212015-07-09 11:30:59193}