blob: c1ce3d589a067398db033c5f9a903b44d84ca65d [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
8buildflag_header("gcm_build_features") {
9 header = "gcm_build_features.h"
10 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",
jitendra.ks70c5b4c2015-08-19 18:53:3417 "gcm_account_tracker.cc",
18 "gcm_account_tracker.h",
satoruxea51ccc2015-02-16 10:14:2419 "gcm_activity.cc",
20 "gcm_activity.h",
[email protected]abd4b682014-07-16 20:26:3021 "gcm_app_handler.cc",
22 "gcm_app_handler.h",
jianli1235e51c2014-09-08 18:56:4123 "gcm_backoff_policy.cc",
24 "gcm_backoff_policy.h",
[email protected]abd4b682014-07-16 20:26:3025 "gcm_client.cc",
26 "gcm_client.h",
Brett Wilson83fd4242014-09-02 19:45:3327 "gcm_connection_observer.cc",
28 "gcm_connection_observer.h",
fgorski05d507c2014-09-10 17:28:1029 "gcm_delayed_task_controller.cc",
30 "gcm_delayed_task_controller.h",
[email protected]abd4b682014-07-16 20:26:3031 "gcm_driver.cc",
32 "gcm_driver.h",
jitendra.ks75541942015-11-03 20:17:5133 "gcm_driver_constants.cc",
34 "gcm_driver_constants.h",
drogere89640c42015-09-15 18:57:4135 "gcm_internals_constants.cc",
36 "gcm_internals_constants.h",
droger08025a22015-11-16 10:58:5137 "gcm_internals_helper.cc",
38 "gcm_internals_helper.h",
jitendra.ks75541942015-11-03 20:17:5139 "gcm_profile_service.cc",
40 "gcm_profile_service.h",
jianli7a0c9b62015-05-26 23:24:4741 "registration_info.cc",
42 "registration_info.h",
[email protected]abd4b682014-07-16 20:26:3043 "system_encryptor.cc",
44 "system_encryptor.h",
45 ]
46
brettwafa8f542016-08-24 05:16:2447 public_deps = [
[email protected]abd4b682014-07-16 20:26:3048 "//base",
tfarina1df94042015-07-22 17:28:4649 "//components/gcm_driver/common",
brettw2629c442015-11-26 02:42:1950 "//components/gcm_driver/crypto",
brettwafa8f542016-08-24 05:16:2451 "//components/gcm_driver/instance_id",
52 ]
53 deps = [
ralphnathaned5c0e02017-06-14 20:54:5654 ":gcm_build_features",
zea76342abf2016-11-01 17:26:0455 "//base:i18n",
brettwafa8f542016-08-24 05:16:2456 "//components/crx_file",
rajendrantbfee22e2017-01-20 20:34:1757 "//components/data_use_measurement/core",
brettw2629c442015-11-26 02:42:1958 "//components/keyed_service/core",
[email protected]abd4b682014-07-16 20:26:3059 "//components/os_crypt",
brettw2629c442015-11-26 02:42:1960 "//components/pref_registry",
brettw9f7802a22016-01-30 06:40:1761 "//components/prefs",
brettw2629c442015-11-26 02:42:1962 "//components/signin/core/browser",
maxbogue455a57e32016-08-14 00:08:3263 "//components/sync",
brettw2629c442015-11-26 02:42:1964 "//components/version_info",
65 "//google_apis",
[email protected]abd4b682014-07-16 20:26:3066 "//google_apis/gcm",
67 "//net",
jitendra.ksb1b7fee2015-09-22 17:42:5368 "//url:url",
[email protected]abd4b682014-07-16 20:26:3069 ]
brettwafa8f542016-08-24 05:16:2470
71 # This target goes with these other deps and they can include headers from
72 # each other.
73 allow_circular_includes_from = [
74 "//components/gcm_driver/crypto",
75 "//components/gcm_driver/instance_id",
76 ]
[email protected]abd4b682014-07-16 20:26:3077
vchigrind853bed2015-01-13 08:31:1878 if (is_chromeos) {
79 deps += [ "//components/timers" ]
80 }
81
ralphnathaned5c0e02017-06-14 20:54:5682 if (use_gcm_from_platform) {
83 sources += [
ralphnathaned5c0e02017-06-14 20:54:5684 "gcm_driver_android.cc",
85 "gcm_driver_android.h",
86 "gcm_stats_recorder_android.cc",
87 "gcm_stats_recorder_android.h",
88 ]
89 } else {
90 sources += [
fgorskid578c18b2014-09-24 23:40:1791 "gcm_account_mapper.cc",
92 "gcm_account_mapper.h",
jianli1235e51c2014-09-08 18:56:4193 "gcm_channel_status_request.cc",
94 "gcm_channel_status_request.h",
jianli2dc910b02014-09-19 02:42:4695 "gcm_channel_status_syncer.cc",
96 "gcm_channel_status_syncer.h",
[email protected]abd4b682014-07-16 20:26:3097 "gcm_client_factory.cc",
98 "gcm_client_factory.h",
99 "gcm_client_impl.cc",
100 "gcm_client_impl.h",
jitendra.ksb1b7fee2015-09-22 17:42:53101 "gcm_desktop_utils.cc",
102 "gcm_desktop_utils.h",
[email protected]abd4b682014-07-16 20:26:30103 "gcm_driver_desktop.cc",
104 "gcm_driver_desktop.h",
105 "gcm_stats_recorder_impl.cc",
106 "gcm_stats_recorder_impl.h",
107 ]
ralphnathaned5c0e02017-06-14 20:54:56108 deps += [
johnme627dc8c72016-08-19 21:49:39109 "//components/crx_file",
110 "//google_apis/gcm",
111 ]
ralphnathaned5c0e02017-06-14 20:54:56112 }
113
114 if (is_android) {
cjhopman11a68cb2014-10-13 22:47:54115 deps += [ "android:jni_headers" ]
[email protected]abd4b682014-07-16 20:26:30116 }
117}
118
brettw77617612016-07-13 22:40:06119static_library("test_support") {
Brett Wilson0c8745a2014-09-08 22:59:49120 testonly = true
[email protected]abd4b682014-07-16 20:26:30121 sources = [
122 "fake_gcm_app_handler.cc",
123 "fake_gcm_app_handler.h",
[email protected]abd4b682014-07-16 20:26:30124 "fake_gcm_driver.cc",
125 "fake_gcm_driver.h",
126 ]
127
brettweab63a52015-10-22 23:47:36128 public_deps = [
[email protected]abd4b682014-07-16 20:26:30129 ":gcm_driver",
brettweab63a52015-10-22 23:47:36130 ]
131 deps = [
[email protected]abd4b682014-07-16 20:26:30132 "//base",
peter245ad212015-07-09 11:30:59133 "//google_apis/gcm:test_support",
brettw2629c442015-11-26 02:42:19134 "//net",
[email protected]abd4b682014-07-16 20:26:30135 "//testing/gtest",
136 ]
137
ralphnathaned5c0e02017-06-14 20:54:56138 if (!use_gcm_from_platform) {
139 sources += [
[email protected]abd4b682014-07-16 20:26:30140 "fake_gcm_client.cc",
141 "fake_gcm_client.h",
142 "fake_gcm_client_factory.cc",
143 "fake_gcm_client_factory.h",
144 ]
ralphnathaned5c0e02017-06-14 20:54:56145 deps += [ "//google_apis/gcm:test_support" ]
[email protected]abd4b682014-07-16 20:26:30146 }
147}
peter245ad212015-07-09 11:30:59148
Mugdha Lakhani2ade6a02018-01-31 14:31:11149# This is part of the components_unittests BUILD target.
pkotwicz59272082015-10-29 19:29:14150source_set("unit_tests") {
151 testonly = true
152
153 sources = [
154 "gcm_account_tracker_unittest.cc",
peter1ed82982015-12-21 17:22:49155 "gcm_delayed_task_controller_unittest.cc",
peter1ed82982015-12-21 17:22:49156 "gcm_stats_recorder_android_unittest.cc",
pkotwicz59272082015-10-29 19:29:14157 ]
158
159 deps = [
160 ":gcm_driver",
161 ":test_support",
brettw2629c442015-11-26 02:42:19162 "//base",
brettw2629c442015-11-26 02:42:19163 "//base/test:test_support",
peteree284ba52016-02-01 11:53:28164 "//components/gcm_driver/crypto",
brettw9f7802a22016-01-30 06:40:17165 "//components/prefs:test_support",
Max Boguefef332d2016-07-28 22:09:09166 "//components/sync/protocol",
brettw2629c442015-11-26 02:42:19167 "//google_apis:test_support",
168 "//google_apis/gcm:test_support",
169 "//net:test_support",
pkotwicz59272082015-10-29 19:29:14170 "//testing/gtest",
Chris Mumforda884aa1f2017-10-24 22:46:32171 "//third_party/leveldatabase",
pkotwicz59272082015-10-29 19:29:14172 "//third_party/protobuf:protobuf_lite",
173 ]
174
ralphnathaned5c0e02017-06-14 20:54:56175 if (!use_gcm_from_platform) {
176 sources += [
agrieve2f114fc2015-07-14 22:18:35177 "gcm_account_mapper_unittest.cc",
178 "gcm_channel_status_request_unittest.cc",
179 "gcm_client_impl_unittest.cc",
agrieve2f114fc2015-07-14 22:18:35180 "gcm_driver_desktop_unittest.cc",
181 "gcm_stats_recorder_impl_unittest.cc",
182 ]
agrieve2f114fc2015-07-14 22:18:35183 }
peter245ad212015-07-09 11:30:59184}