blob: 80a281b71ddb65eb424399394a5c1fd0f9b5bdeb [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
ralphnathaned5c0e02017-06-14 20:54:565import("//build/buildflag_header.gni")
6import("//components/gcm_driver/config.gni")
7
Scott Violet9ae82892018-03-01 18:38:128buildflag_header("gcm_buildflags") {
9 header = "gcm_buildflags.h"
ralphnathaned5c0e02017-06-14 20:54:5610 flags = [ "USE_GCM_FROM_PLATFORM=$use_gcm_from_platform" ]
11}
12
[email protected]abd4b682014-07-16 20:26:3013static_library("gcm_driver") {
14 sources = [
Mugdha Lakhanic3d792e2018-02-13 15:10:1315 "features.cc",
16 "features.h",
satoruxea51ccc2015-02-16 10:14:2417 "gcm_activity.cc",
18 "gcm_activity.h",
[email protected]abd4b682014-07-16 20:26:3019 "gcm_app_handler.cc",
20 "gcm_app_handler.h",
jianli1235e51c2014-09-08 18:56:4121 "gcm_backoff_policy.cc",
22 "gcm_backoff_policy.h",
[email protected]abd4b682014-07-16 20:26:3023 "gcm_client.cc",
24 "gcm_client.h",
Brett Wilson83fd4242014-09-02 19:45:3325 "gcm_connection_observer.cc",
26 "gcm_connection_observer.h",
fgorski05d507c2014-09-10 17:28:1027 "gcm_delayed_task_controller.cc",
28 "gcm_delayed_task_controller.h",
[email protected]abd4b682014-07-16 20:26:3029 "gcm_driver.cc",
30 "gcm_driver.h",
jitendra.ks75541942015-11-03 20:17:5131 "gcm_driver_constants.cc",
32 "gcm_driver_constants.h",
drogere89640c42015-09-15 18:57:4133 "gcm_internals_constants.cc",
34 "gcm_internals_constants.h",
droger08025a22015-11-16 10:58:5135 "gcm_internals_helper.cc",
36 "gcm_internals_helper.h",
jitendra.ks75541942015-11-03 20:17:5137 "gcm_profile_service.cc",
38 "gcm_profile_service.h",
jianli7a0c9b62015-05-26 23:24:4739 "registration_info.cc",
40 "registration_info.h",
[email protected]abd4b682014-07-16 20:26:3041 "system_encryptor.cc",
42 "system_encryptor.h",
Alex Chaud6eff3c2019-08-20 15:57:0943 "web_push_common.cc",
44 "web_push_common.h",
Alex Chaua76a6e32019-06-26 16:20:0145 "web_push_sender.cc",
46 "web_push_sender.h",
[email protected]abd4b682014-07-16 20:26:3047 ]
48
brettwafa8f542016-08-24 05:16:2449 public_deps = [
[email protected]abd4b682014-07-16 20:26:3050 "//base",
tfarina1df94042015-07-22 17:28:4651 "//components/gcm_driver/common",
brettw2629c442015-11-26 02:42:1952 "//components/gcm_driver/crypto",
brettwafa8f542016-08-24 05:16:2453 "//components/gcm_driver/instance_id",
Helen Li5f3d96a2018-08-10 20:37:2454 "//crypto",
brettwafa8f542016-08-24 05:16:2455 ]
Helen Li5f3d96a2018-08-10 20:37:2456
brettwafa8f542016-08-24 05:16:2457 deps = [
Scott Violet9ae82892018-03-01 18:38:1258 ":gcm_buildflags",
zea76342abf2016-11-01 17:26:0459 "//base:i18n",
brettwafa8f542016-08-24 05:16:2460 "//components/crx_file",
brettw2629c442015-11-26 02:42:1961 "//components/keyed_service/core",
[email protected]abd4b682014-07-16 20:26:3062 "//components/os_crypt",
brettw2629c442015-11-26 02:42:1963 "//components/pref_registry",
brettw9f7802a22016-01-30 06:40:1764 "//components/prefs",
Henrique Ferreiro94eb46f2019-07-03 14:38:5665 "//components/signin/public/identity_manager",
maxbogue455a57e32016-08-14 00:08:3266 "//components/sync",
brettw2629c442015-11-26 02:42:1967 "//components/version_info",
68 "//google_apis",
[email protected]abd4b682014-07-16 20:26:3069 "//google_apis/gcm",
70 "//net",
Mark Pilgrim7634f5b52018-06-27 19:53:2771 "//services/network/public/cpp",
Helen Li5f3d96a2018-08-10 20:37:2472 "//services/network/public/mojom",
jitendra.ksb1b7fee2015-09-22 17:42:5373 "//url:url",
[email protected]abd4b682014-07-16 20:26:3074 ]
brettwafa8f542016-08-24 05:16:2475
76 # This target goes with these other deps and they can include headers from
77 # each other.
78 allow_circular_includes_from = [
79 "//components/gcm_driver/crypto",
80 "//components/gcm_driver/instance_id",
81 ]
[email protected]abd4b682014-07-16 20:26:3082
vchigrind853bed2015-01-13 08:31:1883 if (is_chromeos) {
84 deps += [ "//components/timers" ]
85 }
86
ralphnathaned5c0e02017-06-14 20:54:5687 if (use_gcm_from_platform) {
88 sources += [
ralphnathaned5c0e02017-06-14 20:54:5689 "gcm_driver_android.cc",
90 "gcm_driver_android.h",
91 "gcm_stats_recorder_android.cc",
92 "gcm_stats_recorder_android.h",
93 ]
94 } else {
95 sources += [
Colin Blundell021e3e4d2018-04-19 01:03:2496 "account_tracker.cc",
97 "account_tracker.h",
fgorskid578c18b2014-09-24 23:40:1798 "gcm_account_mapper.cc",
99 "gcm_account_mapper.h",
Colin Blundell021e3e4d2018-04-19 01:03:24100 "gcm_account_tracker.cc",
101 "gcm_account_tracker.h",
jianli1235e51c2014-09-08 18:56:41102 "gcm_channel_status_request.cc",
103 "gcm_channel_status_request.h",
jianli2dc910b02014-09-19 02:42:46104 "gcm_channel_status_syncer.cc",
105 "gcm_channel_status_syncer.h",
[email protected]abd4b682014-07-16 20:26:30106 "gcm_client_factory.cc",
107 "gcm_client_factory.h",
108 "gcm_client_impl.cc",
109 "gcm_client_impl.h",
jitendra.ksb1b7fee2015-09-22 17:42:53110 "gcm_desktop_utils.cc",
111 "gcm_desktop_utils.h",
[email protected]abd4b682014-07-16 20:26:30112 "gcm_driver_desktop.cc",
113 "gcm_driver_desktop.h",
114 "gcm_stats_recorder_impl.cc",
115 "gcm_stats_recorder_impl.h",
116 ]
ralphnathaned5c0e02017-06-14 20:54:56117 deps += [
johnme627dc8c72016-08-19 21:49:39118 "//components/crx_file",
119 "//google_apis/gcm",
120 ]
ralphnathaned5c0e02017-06-14 20:54:56121 }
122
123 if (is_android) {
cjhopman11a68cb2014-10-13 22:47:54124 deps += [ "android:jni_headers" ]
[email protected]abd4b682014-07-16 20:26:30125 }
126}
127
brettw77617612016-07-13 22:40:06128static_library("test_support") {
Brett Wilson0c8745a2014-09-08 22:59:49129 testonly = true
[email protected]abd4b682014-07-16 20:26:30130 sources = [
131 "fake_gcm_app_handler.cc",
132 "fake_gcm_app_handler.h",
[email protected]abd4b682014-07-16 20:26:30133 "fake_gcm_driver.cc",
134 "fake_gcm_driver.h",
Peter Beverloo34139462018-04-10 14:18:06135 "fake_gcm_profile_service.cc",
136 "fake_gcm_profile_service.h",
[email protected]abd4b682014-07-16 20:26:30137 ]
138
Nico Weber2517f5c2020-01-13 17:54:55139 public_deps = [ ":gcm_driver" ]
brettweab63a52015-10-22 23:47:36140 deps = [
[email protected]abd4b682014-07-16 20:26:30141 "//base",
Peter Beverloo34139462018-04-10 14:18:06142 "//components/gcm_driver/instance_id:test_support",
peter245ad212015-07-09 11:30:59143 "//google_apis/gcm:test_support",
brettw2629c442015-11-26 02:42:19144 "//net",
Mark Pilgrim7634f5b52018-06-27 19:53:27145 "//services/network:test_support",
146 "//services/network/public/cpp",
Helen Li5f3d96a2018-08-10 20:37:24147 "//services/network/public/mojom",
[email protected]abd4b682014-07-16 20:26:30148 "//testing/gtest",
149 ]
150
Peter Beverloo34139462018-04-10 14:18:06151 # This target goes with Instance ID and they can include headers from each
152 # other.
153 allow_circular_includes_from =
154 [ "//components/gcm_driver/instance_id:test_support" ]
155
156 if (is_ios) {
157 sources -= [
158 "fake_gcm_profile_service.cc",
159 "fake_gcm_profile_service.h",
160 ]
Peter Beverloo34139462018-04-10 14:18:06161 }
162
ralphnathaned5c0e02017-06-14 20:54:56163 if (!use_gcm_from_platform) {
164 sources += [
[email protected]abd4b682014-07-16 20:26:30165 "fake_gcm_client.cc",
166 "fake_gcm_client.h",
167 "fake_gcm_client_factory.cc",
168 "fake_gcm_client_factory.h",
169 ]
ralphnathaned5c0e02017-06-14 20:54:56170 deps += [ "//google_apis/gcm:test_support" ]
[email protected]abd4b682014-07-16 20:26:30171 }
172}
peter245ad212015-07-09 11:30:59173
Mugdha Lakhani2ade6a02018-01-31 14:31:11174# This is part of the components_unittests BUILD target.
pkotwicz59272082015-10-29 19:29:14175source_set("unit_tests") {
176 testonly = true
177
178 sources = [
peter1ed82982015-12-21 17:22:49179 "gcm_delayed_task_controller_unittest.cc",
peter1ed82982015-12-21 17:22:49180 "gcm_stats_recorder_android_unittest.cc",
pkotwicz59272082015-10-29 19:29:14181 ]
182
183 deps = [
184 ":gcm_driver",
185 ":test_support",
brettw2629c442015-11-26 02:42:19186 "//base",
brettw2629c442015-11-26 02:42:19187 "//base/test:test_support",
peteree284ba52016-02-01 11:53:28188 "//components/gcm_driver/crypto",
brettw9f7802a22016-01-30 06:40:17189 "//components/prefs:test_support",
Max Boguefef332d2016-07-28 22:09:09190 "//components/sync/protocol",
brettw2629c442015-11-26 02:42:19191 "//google_apis:test_support",
192 "//google_apis/gcm:test_support",
193 "//net:test_support",
pkotwicz59272082015-10-29 19:29:14194 "//testing/gtest",
Chris Mumforda884aa1f2017-10-24 22:46:32195 "//third_party/leveldatabase",
pkotwicz59272082015-10-29 19:29:14196 "//third_party/protobuf:protobuf_lite",
197 ]
198
Alex Chaua76a6e32019-06-26 16:20:01199 if (!is_ios) {
200 sources += [ "web_push_sender_unittest.cc" ]
201
202 deps += [
203 "//content/test:test_support",
204 "//third_party/re2",
205 ]
206 }
207
ralphnathaned5c0e02017-06-14 20:54:56208 if (!use_gcm_from_platform) {
209 sources += [
Colin Blundell021e3e4d2018-04-19 01:03:24210 "account_tracker_unittest.cc",
agrieve2f114fc2015-07-14 22:18:35211 "gcm_account_mapper_unittest.cc",
Colin Blundell021e3e4d2018-04-19 01:03:24212 "gcm_account_tracker_unittest.cc",
agrieve2f114fc2015-07-14 22:18:35213 "gcm_channel_status_request_unittest.cc",
214 "gcm_client_impl_unittest.cc",
agrieve2f114fc2015-07-14 22:18:35215 "gcm_driver_desktop_unittest.cc",
Alex Chaua76a6e32019-06-26 16:20:01216 "gcm_driver_unittest.cc",
agrieve2f114fc2015-07-14 22:18:35217 "gcm_stats_recorder_impl_unittest.cc",
218 ]
Henrique Ferreiro94eb46f2019-07-03 14:38:56219
220 deps += [ "//components/signin/public/identity_manager:test_support" ]
agrieve2f114fc2015-07-14 22:18:35221 }
peter245ad212015-07-09 11:30:59222}