Roll src/third_party/WebKit 605a979:06cb9e9 (svn 202556:202558)
[chromium-blink-merge.git] / components / invalidation / impl / BUILD.gn
blobbf1b917fb5fcd5259f01765f11ae54ae40506553
1 # 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 if (is_android) {
5   import("//build/config/android/rules.gni")
8 source_set("impl") {
9   sources = [
10     "invalidation_logger.cc",
11     "invalidation_logger.h",
12     "invalidation_logger_observer.h",
13     "invalidation_prefs.cc",
14     "invalidation_prefs.h",
15     "invalidation_service_util.cc",
16     "invalidation_service_util.h",
17     "invalidation_state_tracker.cc",
18     "invalidation_state_tracker.h",
19     "invalidation_switches.cc",
20     "invalidation_switches.h",
21     "invalidator.cc",
22     "invalidator.h",
23     "invalidator_registrar.cc",
24     "invalidator_registrar.h",
25     "invalidator_storage.cc",
26     "invalidator_storage.h",
27     "mock_ack_handler.cc",
28     "mock_ack_handler.h",
29     "profile_invalidation_provider.cc",
30     "profile_invalidation_provider.h",
31     "unacked_invalidation_set.cc",
32     "unacked_invalidation_set.h",
33   ]
34   if (!is_android) {
35     sources += [
36       "gcm_invalidation_bridge.cc",
37       "gcm_invalidation_bridge.h",
38       "gcm_network_channel.cc",
39       "gcm_network_channel.h",
40       "gcm_network_channel_delegate.h",
41       "invalidation_notifier.cc",
42       "invalidation_notifier.h",
43       "non_blocking_invalidator.cc",
44       "non_blocking_invalidator.h",
45       "notifier_reason_util.cc",
46       "notifier_reason_util.h",
47       "p2p_invalidator.cc",
48       "p2p_invalidator.h",
49       "push_client_channel.cc",
50       "push_client_channel.h",
51       "registration_manager.cc",
52       "registration_manager.h",
53       "state_writer.h",
54       "sync_invalidation_listener.cc",
55       "sync_invalidation_listener.h",
56       "sync_system_resources.cc",
57       "sync_system_resources.h",
58       "ticl_invalidation_service.cc",
59       "ticl_invalidation_service.h",
60       "ticl_settings_provider.cc",
61       "ticl_settings_provider.h",
62     ]
63   }
64   public_deps = [
65     "//components/invalidation/public",
66   ]
67   deps = [
68     "//base",
69     "//base:i18n",
70     "//base:prefs",
71     "//components/data_use_measurement/core",
72     "//components/gcm_driver",
73     "//components/keyed_service/core",
74     "//components/pref_registry",
75     "//components/signin/core/browser",
76     "//google_apis",
77     "//jingle:notifier",
78     "//net:net",
80     # TODO(sync): Remove this (http://crbug.com/133352);
81     "//third_party/protobuf:protobuf_lite",
82   ]
84   if (is_android) {
85     sources += [
86       "android/component_jni_registrar.cc",
87       "android/component_jni_registrar.h",
88       "invalidation_service_android.cc",
89       "invalidation_service_android.h",
90     ]
91     deps += [ ":jni_headers" ]
92   }
95 source_set("unit_tests") {
96   testonly = true
97   sources = [
98     "invalidation_logger_unittest.cc",
99   ]
100   deps = [
101     ":impl",
102     ":test_support",
103     "//testing/gmock",
104     "//testing/gtest",
105   ]
107   if (is_android) {
108     sources += [ "invalidation_service_android_unittest.cc" ]
109     deps += [ ":jni_headers" ]
110   } else {
111     # Non-Android tests.
112     sources += [
113       "fake_invalidator_unittest.cc",
114       "gcm_network_channel_unittest.cc",
115       "invalidation_notifier_unittest.cc",
116       "invalidator_registrar_unittest.cc",
117       "non_blocking_invalidator_unittest.cc",
118       "object_id_invalidation_map_unittest.cc",
119       "p2p_invalidator_unittest.cc",
120       "push_client_channel_unittest.cc",
121       "registration_manager_unittest.cc",
122       "single_object_invalidation_set_unittest.cc",
123       "sync_invalidation_listener_unittest.cc",
124       "sync_system_resources_unittest.cc",
125       "ticl_invalidation_service_unittest.cc",
126       "unacked_invalidation_set_unittest.cc",
127     ]
128   }
131 static_library("test_support") {
132   testonly = true
133   sources = [
134     "fake_invalidation_handler.cc",
135     "fake_invalidation_handler.h",
136     "fake_invalidation_state_tracker.cc",
137     "fake_invalidation_state_tracker.h",
138     "fake_invalidator.cc",
139     "fake_invalidator.h",
140     "invalidation_service_test_template.cc",
141     "invalidation_service_test_template.h",
142     "invalidation_test_util.cc",
143     "invalidation_test_util.h",
144     "invalidator_test_template.cc",
145     "invalidator_test_template.h",
146     "object_id_invalidation_map_test_util.cc",
147     "object_id_invalidation_map_test_util.h",
148     "unacked_invalidation_set_test_util.cc",
149     "unacked_invalidation_set_test_util.h",
150   ]
152   public_deps = [
153     ":impl",
154     "//jingle:notifier_test_util",
155     "//third_party/cacheinvalidation",
156   ]
157   deps = [
158     "//base",
159     "//components/gcm_driver:test_support",
160     "//components/keyed_service/core",
161     "//google_apis",
162     "//jingle:notifier",
163     "//net",
164     "//testing/gmock",
166     # TODO(sync): Remove this (http://crbug.com/133352);
167     "//third_party/protobuf:protobuf_lite",
169     # "//third_party/cacheinvalidation/src/google/cacheinvalidation:cacheinvalidation_proto_cpp",
170   ]
172   if (is_android) {
173     deps += [ ":jni_headers" ]
174   } else {
175     sources += [
176       "p2p_invalidation_service.cc",
177       "p2p_invalidation_service.h",
178     ]
179   }
182 if (is_android) {
183   android_library("java") {
184     deps = [
185       ":proto_java",
186       "//base:base_java",
187       "//sync/android:sync_java",
188       "//third_party/android_protobuf:protobuf_nano_javalib",
189       "//third_party/cacheinvalidation:cacheinvalidation_javalib",
190       "//third_party/cacheinvalidation:cacheinvalidation_proto_java",
191       "//third_party/jsr-305:jsr_305_javalib",
192     ]
193     DEPRECATED_java_in_dir = "android/java/src"
194   }
195   proto_java_library("proto_java") {
196     proto_path = "android/proto"
197     sources = [
198       "$proto_path/serialized_invalidation.proto",
199     ]
200   }
201   android_library("javatests") {
202     deps = [
203       ":java",
204       "//base:base_java",
205       "//base:base_java_test_support",
206       "//sync/android:sync_java",
207       "//third_party/cacheinvalidation:cacheinvalidation_javalib",
208       "//third_party/cacheinvalidation:cacheinvalidation_proto_java",
209     ]
210     DEPRECATED_java_in_dir = "android/javatests/src"
211   }
212   junit_binary("junit_tests") {
213     java_files = [ "android/junit/src/org/chromium/components/invalidation/PendingInvalidationTest.java" ]
214     deps = [
215       ":java",
216       "//base:base_java",
217       "//base:base_java_test_support",
218     ]
219   }
220   generate_jni("jni_headers") {
221     sources = [
222       "android/java/src/org/chromium/components/invalidation/InvalidationService.java",
223     ]
224     jni_package = "components/invalidation"
225   }