blob: 4641dbedd39d27cb6e7fd92c50a42e514ce81d6b [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",
43 ]
44
brettwafa8f542016-08-24 05:16:2445 public_deps = [
[email protected]abd4b682014-07-16 20:26:3046 "//base",
tfarina1df94042015-07-22 17:28:4647 "//components/gcm_driver/common",
brettw2629c442015-11-26 02:42:1948 "//components/gcm_driver/crypto",
brettwafa8f542016-08-24 05:16:2449 "//components/gcm_driver/instance_id",
50 ]
51 deps = [
Scott Violet9ae82892018-03-01 18:38:1252 ":gcm_buildflags",
zea76342abf2016-11-01 17:26:0453 "//base:i18n",
brettwafa8f542016-08-24 05:16:2454 "//components/crx_file",
rajendrantbfee22e2017-01-20 20:34:1755 "//components/data_use_measurement/core",
brettw2629c442015-11-26 02:42:1956 "//components/keyed_service/core",
[email protected]abd4b682014-07-16 20:26:3057 "//components/os_crypt",
brettw2629c442015-11-26 02:42:1958 "//components/pref_registry",
brettw9f7802a22016-01-30 06:40:1759 "//components/prefs",
brettw2629c442015-11-26 02:42:1960 "//components/signin/core/browser",
maxbogue455a57e32016-08-14 00:08:3261 "//components/sync",
brettw2629c442015-11-26 02:42:1962 "//components/version_info",
63 "//google_apis",
[email protected]abd4b682014-07-16 20:26:3064 "//google_apis/gcm",
65 "//net",
jitendra.ksb1b7fee2015-09-22 17:42:5366 "//url:url",
[email protected]abd4b682014-07-16 20:26:3067 ]
brettwafa8f542016-08-24 05:16:2468
69 # This target goes with these other deps and they can include headers from
70 # each other.
71 allow_circular_includes_from = [
72 "//components/gcm_driver/crypto",
73 "//components/gcm_driver/instance_id",
74 ]
[email protected]abd4b682014-07-16 20:26:3075
vchigrind853bed2015-01-13 08:31:1876 if (is_chromeos) {
77 deps += [ "//components/timers" ]
78 }
79
ralphnathaned5c0e02017-06-14 20:54:5680 if (use_gcm_from_platform) {
81 sources += [
ralphnathaned5c0e02017-06-14 20:54:5682 "gcm_driver_android.cc",
83 "gcm_driver_android.h",
84 "gcm_stats_recorder_android.cc",
85 "gcm_stats_recorder_android.h",
86 ]
87 } else {
88 sources += [
Colin Blundell021e3e4d2018-04-19 01:03:2489 "account_tracker.cc",
90 "account_tracker.h",
fgorskid578c18b2014-09-24 23:40:1791 "gcm_account_mapper.cc",
92 "gcm_account_mapper.h",
Colin Blundell021e3e4d2018-04-19 01:03:2493 "gcm_account_tracker.cc",
94 "gcm_account_tracker.h",
jianli1235e51c2014-09-08 18:56:4195 "gcm_channel_status_request.cc",
96 "gcm_channel_status_request.h",
jianli2dc910b02014-09-19 02:42:4697 "gcm_channel_status_syncer.cc",
98 "gcm_channel_status_syncer.h",
[email protected]abd4b682014-07-16 20:26:3099 "gcm_client_factory.cc",
100 "gcm_client_factory.h",
101 "gcm_client_impl.cc",
102 "gcm_client_impl.h",
jitendra.ksb1b7fee2015-09-22 17:42:53103 "gcm_desktop_utils.cc",
104 "gcm_desktop_utils.h",
[email protected]abd4b682014-07-16 20:26:30105 "gcm_driver_desktop.cc",
106 "gcm_driver_desktop.h",
107 "gcm_stats_recorder_impl.cc",
108 "gcm_stats_recorder_impl.h",
109 ]
ralphnathaned5c0e02017-06-14 20:54:56110 deps += [
johnme627dc8c72016-08-19 21:49:39111 "//components/crx_file",
112 "//google_apis/gcm",
113 ]
ralphnathaned5c0e02017-06-14 20:54:56114 }
115
116 if (is_android) {
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",
[email protected]abd4b682014-07-16 20:26:30126 "fake_gcm_driver.cc",
127 "fake_gcm_driver.h",
Peter Beverloo34139462018-04-10 14:18:06128 "fake_gcm_profile_service.cc",
129 "fake_gcm_profile_service.h",
[email protected]abd4b682014-07-16 20:26:30130 ]
131
brettweab63a52015-10-22 23:47:36132 public_deps = [
[email protected]abd4b682014-07-16 20:26:30133 ":gcm_driver",
brettweab63a52015-10-22 23:47:36134 ]
135 deps = [
[email protected]abd4b682014-07-16 20:26:30136 "//base",
Peter Beverloo34139462018-04-10 14:18:06137 "//components/gcm_driver/instance_id:test_support",
138 "//content/public/browser",
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
Peter Beverloo34139462018-04-10 14:18:06144 # This target goes with Instance ID and they can include headers from each
145 # other.
146 allow_circular_includes_from =
147 [ "//components/gcm_driver/instance_id:test_support" ]
148
149 if (is_ios) {
150 sources -= [
151 "fake_gcm_profile_service.cc",
152 "fake_gcm_profile_service.h",
153 ]
154
155 deps -= [ "//content/public/browser" ]
156 }
157
ralphnathaned5c0e02017-06-14 20:54:56158 if (!use_gcm_from_platform) {
159 sources += [
[email protected]abd4b682014-07-16 20:26:30160 "fake_gcm_client.cc",
161 "fake_gcm_client.h",
162 "fake_gcm_client_factory.cc",
163 "fake_gcm_client_factory.h",
164 ]
ralphnathaned5c0e02017-06-14 20:54:56165 deps += [ "//google_apis/gcm:test_support" ]
[email protected]abd4b682014-07-16 20:26:30166 }
167}
peter245ad212015-07-09 11:30:59168
Mugdha Lakhani2ade6a02018-01-31 14:31:11169# This is part of the components_unittests BUILD target.
pkotwicz59272082015-10-29 19:29:14170source_set("unit_tests") {
171 testonly = true
172
173 sources = [
peter1ed82982015-12-21 17:22:49174 "gcm_delayed_task_controller_unittest.cc",
peter1ed82982015-12-21 17:22:49175 "gcm_stats_recorder_android_unittest.cc",
pkotwicz59272082015-10-29 19:29:14176 ]
177
178 deps = [
179 ":gcm_driver",
180 ":test_support",
brettw2629c442015-11-26 02:42:19181 "//base",
brettw2629c442015-11-26 02:42:19182 "//base/test:test_support",
peteree284ba52016-02-01 11:53:28183 "//components/gcm_driver/crypto",
brettw9f7802a22016-01-30 06:40:17184 "//components/prefs:test_support",
Max Boguefef332d2016-07-28 22:09:09185 "//components/sync/protocol",
brettw2629c442015-11-26 02:42:19186 "//google_apis:test_support",
187 "//google_apis/gcm:test_support",
188 "//net:test_support",
pkotwicz59272082015-10-29 19:29:14189 "//testing/gtest",
Chris Mumforda884aa1f2017-10-24 22:46:32190 "//third_party/leveldatabase",
pkotwicz59272082015-10-29 19:29:14191 "//third_party/protobuf:protobuf_lite",
192 ]
193
ralphnathaned5c0e02017-06-14 20:54:56194 if (!use_gcm_from_platform) {
195 sources += [
Colin Blundell021e3e4d2018-04-19 01:03:24196 "account_tracker_unittest.cc",
agrieve2f114fc2015-07-14 22:18:35197 "gcm_account_mapper_unittest.cc",
Colin Blundell021e3e4d2018-04-19 01:03:24198 "gcm_account_tracker_unittest.cc",
agrieve2f114fc2015-07-14 22:18:35199 "gcm_channel_status_request_unittest.cc",
200 "gcm_client_impl_unittest.cc",
agrieve2f114fc2015-07-14 22:18:35201 "gcm_driver_desktop_unittest.cc",
202 "gcm_stats_recorder_impl_unittest.cc",
203 ]
agrieve2f114fc2015-07-14 22:18:35204 }
peter245ad212015-07-09 11:30:59205}