Infobar material design refresh: bg color
[chromium-blink-merge.git] / sync / BUILD.gn
blob110f7c5fca9cbd90b3d14352f3d5483a3e33b800
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.
5 import("//build/config/features.gni")
6 import("//testing/test.gni")
8 component("sync") {
9   public_deps = [
10     ":sync_core",
11     "//sync/protocol",
12   ]
15 # GYP version: sync/sync.gyp:sync_core
16 source_set("sync_core") {
17   sources = [
18     "api/attachments/attachment.cc",
19     "api/attachments/attachment.h",
20     "api/attachments/attachment_id.cc",
21     "api/attachments/attachment_id.h",
22     "api/attachments/attachment_metadata.cc",
23     "api/attachments/attachment_metadata.h",
24     "api/attachments/attachment_store.cc",
25     "api/attachments/attachment_store.h",
26     "api/attachments/attachment_store_backend.cc",
27     "api/attachments/attachment_store_backend.h",
28     "api/string_ordinal.h",
29     "api/sync_change.cc",
30     "api/sync_change.h",
31     "api/sync_change_processor.cc",
32     "api/sync_change_processor.h",
33     "api/sync_data.cc",
34     "api/sync_data.h",
35     "api/sync_error.cc",
36     "api/sync_error.h",
37     "api/sync_error_factory.cc",
38     "api/sync_error_factory.h",
39     "api/sync_merge_result.cc",
40     "api/sync_merge_result.h",
41     "api/syncable_service.cc",
42     "api/syncable_service.h",
43     "api/time.h",
44     "base/sync_export.h",
45     "engine/all_status.cc",
46     "engine/all_status.h",
47     "engine/apply_control_data_updates.cc",
48     "engine/apply_control_data_updates.h",
49     "engine/backoff_delay_provider.cc",
50     "engine/backoff_delay_provider.h",
51     "engine/clear_server_data.cc",
52     "engine/clear_server_data.h",
53     "engine/commit.cc",
54     "engine/commit.h",
55     "engine/commit_contribution.cc",
56     "engine/commit_contribution.h",
57     "engine/commit_contributor.cc",
58     "engine/commit_contributor.h",
59     "engine/commit_processor.cc",
60     "engine/commit_processor.h",
61     "engine/commit_queue.cc",
62     "engine/commit_queue.h",
63     "engine/commit_util.cc",
64     "engine/commit_util.h",
65     "engine/conflict_resolver.cc",
66     "engine/conflict_resolver.h",
67     "engine/conflict_util.cc",
68     "engine/conflict_util.h",
69     "engine/directory_commit_contribution.cc",
70     "engine/directory_commit_contribution.h",
71     "engine/directory_commit_contributor.cc",
72     "engine/directory_commit_contributor.h",
73     "engine/directory_update_handler.cc",
74     "engine/directory_update_handler.h",
75     "engine/entity_tracker.cc",
76     "engine/entity_tracker.h",
77     "engine/get_commit_ids.cc",
78     "engine/get_commit_ids.h",
79     "engine/get_updates_delegate.cc",
80     "engine/get_updates_delegate.h",
81     "engine/get_updates_processor.cc",
82     "engine/get_updates_processor.h",
83     "engine/model_type_entity.cc",
84     "engine/model_type_entity.h",
85     "engine/model_type_processor.cc",
86     "engine/model_type_processor.h",
87     "engine/model_type_processor_impl.cc",
88     "engine/model_type_processor_impl.h",
89     "engine/model_type_sync_worker_impl.cc",
90     "engine/model_type_sync_worker_impl.h",
91     "engine/net/server_connection_manager.cc",
92     "engine/net/server_connection_manager.h",
93     "engine/net/url_translator.cc",
94     "engine/net/url_translator.h",
95     "engine/non_blocking_type_commit_contribution.cc",
96     "engine/non_blocking_type_commit_contribution.h",
97     "engine/nudge_handler.cc",
98     "engine/nudge_handler.h",
99     "engine/nudge_source.cc",
100     "engine/nudge_source.h",
101     "engine/process_updates_util.cc",
102     "engine/process_updates_util.h",
103     "engine/sync_cycle_event.cc",
104     "engine/sync_cycle_event.h",
105     "engine/sync_engine_event_listener.cc",
106     "engine/sync_engine_event_listener.h",
107     "engine/sync_scheduler.cc",
108     "engine/sync_scheduler.h",
109     "engine/sync_scheduler_impl.cc",
110     "engine/sync_scheduler_impl.h",
111     "engine/syncer.cc",
112     "engine/syncer.h",
113     "engine/syncer_proto_util.cc",
114     "engine/syncer_proto_util.h",
115     "engine/syncer_types.h",
116     "engine/syncer_util.cc",
117     "engine/syncer_util.h",
118     "engine/traffic_logger.cc",
119     "engine/traffic_logger.h",
120     "engine/update_applicator.cc",
121     "engine/update_applicator.h",
122     "engine/update_handler.cc",
123     "engine/update_handler.h",
124     "internal_api/attachments/attachment_downloader.cc",
125     "internal_api/attachments/attachment_downloader_impl.cc",
126     "internal_api/attachments/attachment_service.cc",
127     "internal_api/attachments/attachment_service_impl.cc",
128     "internal_api/attachments/attachment_service_proxy.cc",
129     "internal_api/attachments/attachment_service_proxy_for_test.cc",
130     "internal_api/attachments/attachment_store_frontend.cc",
131     "internal_api/attachments/attachment_uploader.cc",
132     "internal_api/attachments/attachment_uploader_impl.cc",
133     "internal_api/attachments/attachment_util.cc",
134     "internal_api/attachments/fake_attachment_downloader.cc",
135     "internal_api/attachments/fake_attachment_uploader.cc",
136     "internal_api/attachments/in_memory_attachment_store.cc",
137     "internal_api/attachments/on_disk_attachment_store.cc",
138     "internal_api/attachments/task_queue.cc",
139     "internal_api/base_node.cc",
140     "internal_api/base_transaction.cc",
141     "internal_api/change_record.cc",
142     "internal_api/change_reorder_buffer.cc",
143     "internal_api/change_reorder_buffer.h",
144     "internal_api/debug_info_event_listener.cc",
145     "internal_api/debug_info_event_listener.h",
146     "internal_api/delete_journal.cc",
147     "internal_api/events/clear_server_data_request_event.cc",
148     "internal_api/events/clear_server_data_response_event.cc",
149     "internal_api/events/commit_request_event.cc",
150     "internal_api/events/commit_response_event.cc",
151     "internal_api/events/configure_get_updates_request_event.cc",
152     "internal_api/events/get_updates_response_event.cc",
153     "internal_api/events/normal_get_updates_request_event.cc",
154     "internal_api/events/poll_get_updates_request_event.cc",
155     "internal_api/events/protocol_event.cc",
156     "internal_api/http_bridge.cc",
157     "internal_api/http_bridge_network_resources.cc",
158     "internal_api/internal_components_factory_impl.cc",
159     "internal_api/js_mutation_event_observer.cc",
160     "internal_api/js_mutation_event_observer.h",
161     "internal_api/js_sync_encryption_handler_observer.cc",
162     "internal_api/js_sync_encryption_handler_observer.h",
163     "internal_api/js_sync_manager_observer.cc",
164     "internal_api/js_sync_manager_observer.h",
165     "internal_api/protocol_event_buffer.cc",
166     "internal_api/protocol_event_buffer.h",
167     "internal_api/public/attachments/attachment_downloader.h",
168     "internal_api/public/attachments/attachment_downloader_impl.h",
169     "internal_api/public/attachments/attachment_service.h",
170     "internal_api/public/attachments/attachment_service_impl.h",
171     "internal_api/public/attachments/attachment_service_proxy.h",
172     "internal_api/public/attachments/attachment_service_proxy_for_test.h",
173     "internal_api/public/attachments/attachment_store_frontend.h",
174     "internal_api/public/attachments/attachment_uploader.h",
175     "internal_api/public/attachments/attachment_uploader_impl.h",
176     "internal_api/public/attachments/attachment_util.h",
177     "internal_api/public/attachments/fake_attachment_downloader.h",
178     "internal_api/public/attachments/fake_attachment_uploader.h",
179     "internal_api/public/attachments/in_memory_attachment_store.h",
180     "internal_api/public/attachments/on_disk_attachment_store.h",
181     "internal_api/public/base/attachment_id_proto.cc",
182     "internal_api/public/base/attachment_id_proto.h",
183     "internal_api/public/base/cancelation_observer.cc",
184     "internal_api/public/base/cancelation_observer.h",
185     "internal_api/public/base/cancelation_signal.cc",
186     "internal_api/public/base/cancelation_signal.h",
187     "internal_api/public/base/enum_set.h",
188     "internal_api/public/base/invalidation_interface.cc",
189     "internal_api/public/base/invalidation_interface.h",
190     "internal_api/public/base/model_type.h",
191     "internal_api/public/base/node_ordinal.cc",
192     "internal_api/public/base/node_ordinal.h",
193     "internal_api/public/base/ordinal.h",
194     "internal_api/public/base/progress_marker_map.cc",
195     "internal_api/public/base/progress_marker_map.h",
196     "internal_api/public/base/unique_position.cc",
197     "internal_api/public/base/unique_position.h",
198     "internal_api/public/base_node.h",
199     "internal_api/public/base_transaction.h",
200     "internal_api/public/change_record.h",
201     "internal_api/public/configure_reason.h",
202     "internal_api/public/data_type_association_stats.cc",
203     "internal_api/public/data_type_association_stats.h",
204     "internal_api/public/data_type_debug_info_listener.cc",
205     "internal_api/public/data_type_debug_info_listener.h",
206     "internal_api/public/delete_journal.h",
207     "internal_api/public/engine/model_safe_worker.cc",
208     "internal_api/public/engine/model_safe_worker.h",
209     "internal_api/public/engine/passive_model_worker.cc",
210     "internal_api/public/engine/passive_model_worker.h",
211     "internal_api/public/engine/polling_constants.cc",
212     "internal_api/public/engine/polling_constants.h",
213     "internal_api/public/engine/sync_status.cc",
214     "internal_api/public/engine/sync_status.h",
215     "internal_api/public/events/clear_server_data_request_event.h",
216     "internal_api/public/events/clear_server_data_response_event.h",
217     "internal_api/public/events/commit_request_event.h",
218     "internal_api/public/events/commit_response_event.h",
219     "internal_api/public/events/configure_get_updates_request_event.h",
220     "internal_api/public/events/get_updates_response_event.h",
221     "internal_api/public/events/normal_get_updates_request_event.h",
222     "internal_api/public/events/poll_get_updates_request_event.h",
223     "internal_api/public/events/protocol_event.h",
224     "internal_api/public/http_bridge.h",
225     "internal_api/public/http_bridge_network_resources.h",
226     "internal_api/public/http_post_provider_factory.h",
227     "internal_api/public/http_post_provider_interface.h",
228     "internal_api/public/internal_components_factory.h",
229     "internal_api/public/internal_components_factory_impl.h",
230     "internal_api/public/network_resources.h",
231     "internal_api/public/non_blocking_sync_common.cc",
232     "internal_api/public/non_blocking_sync_common.h",
233     "internal_api/public/read_node.h",
234     "internal_api/public/read_transaction.h",
235     "internal_api/public/sessions/commit_counters.cc",
236     "internal_api/public/sessions/commit_counters.h",
237     "internal_api/public/sessions/model_neutral_state.cc",
238     "internal_api/public/sessions/model_neutral_state.h",
239     "internal_api/public/sessions/status_counters.cc",
240     "internal_api/public/sessions/status_counters.h",
241     "internal_api/public/sessions/sync_session_snapshot.cc",
242     "internal_api/public/sessions/sync_session_snapshot.h",
243     "internal_api/public/sessions/type_debug_info_observer.cc",
244     "internal_api/public/sessions/type_debug_info_observer.h",
245     "internal_api/public/sessions/update_counters.cc",
246     "internal_api/public/sessions/update_counters.h",
247     "internal_api/public/shutdown_reason.h",
248     "internal_api/public/sync_auth_provider.h",
249     "internal_api/public/sync_context.h",
250     "internal_api/public/sync_context_proxy.h",
251     "internal_api/public/sync_encryption_handler.cc",
252     "internal_api/public/sync_encryption_handler.h",
253     "internal_api/public/sync_manager.cc",
254     "internal_api/public/sync_manager.h",
255     "internal_api/public/sync_manager_factory.h",
256     "internal_api/public/user_share.h",
257     "internal_api/public/util/experiments.h",
258     "internal_api/public/util/immutable.h",
259     "internal_api/public/util/sync_db_util.h",
260     "internal_api/public/util/sync_string_conversions.cc",
261     "internal_api/public/util/sync_string_conversions.h",
262     "internal_api/public/util/syncer_error.cc",
263     "internal_api/public/util/syncer_error.h",
264     "internal_api/public/util/unrecoverable_error_handler.h",
265     "internal_api/public/util/unrecoverable_error_info.cc",
266     "internal_api/public/util/unrecoverable_error_info.h",
267     "internal_api/public/util/weak_handle.cc",
268     "internal_api/public/util/weak_handle.h",
269     "internal_api/public/write_node.h",
270     "internal_api/public/write_transaction.h",
271     "internal_api/read_node.cc",
272     "internal_api/read_transaction.cc",
273     "internal_api/sync_backup_manager.cc",
274     "internal_api/sync_backup_manager.h",
275     "internal_api/sync_context.cc",
276     "internal_api/sync_context_proxy.cc",
277     "internal_api/sync_context_proxy_impl.cc",
278     "internal_api/sync_context_proxy_impl.h",
279     "internal_api/sync_db_util.cc",
280     "internal_api/sync_encryption_handler_impl.cc",
281     "internal_api/sync_encryption_handler_impl.h",
282     "internal_api/sync_manager_factory.cc",
283     "internal_api/sync_manager_impl.cc",
284     "internal_api/sync_manager_impl.h",
285     "internal_api/sync_rollback_manager.cc",
286     "internal_api/sync_rollback_manager.h",
287     "internal_api/sync_rollback_manager_base.cc",
288     "internal_api/sync_rollback_manager_base.h",
289     "internal_api/syncapi_internal.cc",
290     "internal_api/syncapi_internal.h",
291     "internal_api/syncapi_server_connection_manager.cc",
292     "internal_api/syncapi_server_connection_manager.h",
293     "internal_api/user_share.cc",
294     "internal_api/write_node.cc",
295     "internal_api/write_transaction.cc",
296     "js/js_backend.h",
297     "js/js_controller.h",
298     "js/js_event_details.cc",
299     "js/js_event_details.h",
300     "js/js_event_handler.h",
301     "js/sync_js_controller.cc",
302     "js/sync_js_controller.h",
303     "protocol/proto_enum_conversions.cc",
304     "protocol/proto_enum_conversions.h",
305     "protocol/proto_value_conversions.cc",
306     "protocol/proto_value_conversions.h",
307     "protocol/sync_protocol_error.cc",
308     "protocol/sync_protocol_error.h",
309     "sessions/data_type_tracker.cc",
310     "sessions/data_type_tracker.h",
311     "sessions/debug_info_getter.h",
312     "sessions/directory_type_debug_info_emitter.cc",
313     "sessions/directory_type_debug_info_emitter.h",
314     "sessions/model_type_registry.cc",
315     "sessions/model_type_registry.h",
316     "sessions/nudge_tracker.cc",
317     "sessions/nudge_tracker.h",
318     "sessions/status_controller.cc",
319     "sessions/status_controller.h",
320     "sessions/sync_session.cc",
321     "sessions/sync_session.h",
322     "sessions/sync_session_context.cc",
323     "sessions/sync_session_context.h",
324     "syncable/deferred_on_disk_directory_backing_store.cc",
325     "syncable/deferred_on_disk_directory_backing_store.h",
326     "syncable/dir_open_result.h",
327     "syncable/directory.cc",
328     "syncable/directory.h",
329     "syncable/directory_backing_store.cc",
330     "syncable/directory_backing_store.h",
331     "syncable/directory_change_delegate.h",
332     "syncable/entry.cc",
333     "syncable/entry.h",
334     "syncable/entry_kernel.cc",
335     "syncable/entry_kernel.h",
336     "syncable/in_memory_directory_backing_store.cc",
337     "syncable/in_memory_directory_backing_store.h",
338     "syncable/invalid_directory_backing_store.cc",
339     "syncable/invalid_directory_backing_store.h",
340     "syncable/metahandle_set.h",
341     "syncable/model_neutral_mutable_entry.cc",
342     "syncable/model_neutral_mutable_entry.h",
343     "syncable/model_type.cc",
344     "syncable/mutable_entry.cc",
345     "syncable/mutable_entry.h",
346     "syncable/nigori_handler.cc",
347     "syncable/nigori_handler.h",
348     "syncable/nigori_util.cc",
349     "syncable/nigori_util.h",
350     "syncable/on_disk_directory_backing_store.cc",
351     "syncable/on_disk_directory_backing_store.h",
352     "syncable/parent_child_index.cc",
353     "syncable/parent_child_index.h",
354     "syncable/proto_value_ptr.h",
355     "syncable/scoped_kernel_lock.cc",
356     "syncable/scoped_kernel_lock.h",
357     "syncable/scoped_parent_child_index_updater.cc",
358     "syncable/scoped_parent_child_index_updater.h",
359     "syncable/syncable-inl.h",
360     "syncable/syncable_base_transaction.cc",
361     "syncable/syncable_base_transaction.h",
362     "syncable/syncable_base_write_transaction.cc",
363     "syncable/syncable_base_write_transaction.h",
364     "syncable/syncable_changes_version.h",
365     "syncable/syncable_columns.h",
366     "syncable/syncable_delete_journal.cc",
367     "syncable/syncable_delete_journal.h",
368     "syncable/syncable_enum_conversions.cc",
369     "syncable/syncable_enum_conversions.h",
370     "syncable/syncable_id.cc",
371     "syncable/syncable_id.h",
372     "syncable/syncable_model_neutral_write_transaction.cc",
373     "syncable/syncable_model_neutral_write_transaction.h",
374     "syncable/syncable_proto_util.cc",
375     "syncable/syncable_proto_util.h",
376     "syncable/syncable_read_transaction.cc",
377     "syncable/syncable_read_transaction.h",
378     "syncable/syncable_util.cc",
379     "syncable/syncable_util.h",
380     "syncable/syncable_write_transaction.cc",
381     "syncable/syncable_write_transaction.h",
382     "syncable/transaction_observer.h",
383     "syncable/write_transaction_info.cc",
384     "syncable/write_transaction_info.h",
385     "util/cryptographer.cc",
386     "util/cryptographer.h",
387     "util/data_type_histogram.cc",
388     "util/data_type_histogram.h",
389     "util/encryptor.h",
390     "util/extensions_activity.cc",
391     "util/extensions_activity.h",
392     "util/get_session_name.cc",
393     "util/get_session_name.h",
394     "util/get_session_name_ios.h",
395     "util/get_session_name_ios.mm",
396     "util/get_session_name_linux.cc",
397     "util/get_session_name_linux.h",
398     "util/get_session_name_mac.h",
399     "util/get_session_name_mac.mm",
400     "util/get_session_name_win.cc",
401     "util/get_session_name_win.h",
402     "util/logging.cc",
403     "util/logging.h",
404     "util/nigori.cc",
405     "util/nigori.h",
406     "util/time.cc",
407     "util/time.h",
408   ]
410   configs += [ "//build/config:precompiled_headers" ]
412   public_deps = [
413     "//sync/internal_api/attachments/proto",
414   ]
415   deps = [
416     "//base",
417     "//base:i18n",
418     "//base/third_party/dynamic_annotations",
419     "//crypto",
420     "//google_apis",
421     "//net",
422     "//sql",
423     "//third_party/leveldatabase",
424     "//third_party/zlib",
425     "//url",
426     "//sync/protocol",
427   ]
429   if (is_android) {
430     deps += [ "//sync/android:jni_headers" ]
431     sources += [
432       "android/model_type_helper.cc",
433       "android/model_type_helper.h",
434       "android/sync_jni_registrar.cc",
435       "android/sync_jni_registrar.h",
436     ]
437   }
439   if (is_chromeos) {
440     # Required by get_session_name.cc on Chrome OS.
441     deps += [ "//chromeos" ]
442   }
444   if (is_mac) {
445     libs = [
446       # Required by get_session_name_mac.mm on Mac.
447       "SystemConfiguration.framework",
448     ]
449   }
451   defines = [ "SYNC_IMPLEMENTATION" ]
452   configs += [ "//build/config/compiler:wexit_time_destructors" ]
455 # GYP version: sync/sync_tests.gypi:test_support_sync_core
456 static_library("test_support_sync_core") {
457   testonly = true
458   sources = [
459     "internal_api/public/base/model_type_test_util.cc",
460     "internal_api/public/base/model_type_test_util.h",
461     "js/js_test_util.cc",
462     "js/js_test_util.h",
463     "sessions/test_util.cc",
464     "sessions/test_util.h",
465     "test/callback_counter.h",
466     "test/directory_backing_store_corruption_testing.cc",
467     "test/directory_backing_store_corruption_testing.h",
468     "test/engine/fake_model_worker.cc",
469     "test/engine/fake_model_worker.h",
470     "test/engine/fake_sync_scheduler.cc",
471     "test/engine/fake_sync_scheduler.h",
472     "test/engine/injectable_sync_context_proxy.cc",
473     "test/engine/injectable_sync_context_proxy.h",
474     "test/engine/mock_commit_queue.cc",
475     "test/engine/mock_commit_queue.h",
476     "test/engine/mock_connection_manager.cc",
477     "test/engine/mock_connection_manager.h",
478     "test/engine/mock_model_type_processor.cc",
479     "test/engine/mock_model_type_processor.h",
480     "test/engine/mock_nudge_handler.cc",
481     "test/engine/mock_nudge_handler.h",
482     "test/engine/mock_update_handler.cc",
483     "test/engine/mock_update_handler.h",
484     "test/engine/single_type_mock_server.cc",
485     "test/engine/single_type_mock_server.h",
486     "test/engine/test_directory_setter_upper.cc",
487     "test/engine/test_directory_setter_upper.h",
488     "test/engine/test_id_factory.h",
489     "test/engine/test_syncable_utils.cc",
490     "test/engine/test_syncable_utils.h",
491     "test/fake_encryptor.cc",
492     "test/fake_encryptor.h",
493     "test/fake_sync_encryption_handler.cc",
494     "test/fake_sync_encryption_handler.h",
495     "test/mock_invalidation.cc",
496     "test/mock_invalidation.h",
497     "test/mock_invalidation_tracker.cc",
498     "test/mock_invalidation_tracker.h",
499     "test/null_directory_change_delegate.cc",
500     "test/null_directory_change_delegate.h",
501     "test/null_transaction_observer.cc",
502     "test/null_transaction_observer.h",
503     "test/sessions/mock_debug_info_getter.cc",
504     "test/sessions/mock_debug_info_getter.h",
505     "test/sessions/test_scoped_session_event_listener.h",
506     "test/test_directory_backing_store.cc",
507     "test/test_directory_backing_store.h",
508     "test/test_transaction_observer.cc",
509     "test/test_transaction_observer.h",
510     "test/trackable_mock_invalidation.cc",
511     "test/trackable_mock_invalidation.h",
512     "util/mock_unrecoverable_error_handler.cc",
513     "util/mock_unrecoverable_error_handler.h",
514     "util/test_unrecoverable_error_handler.cc",
515     "util/test_unrecoverable_error_handler.h",
516   ]
518   public_deps = [
519     "//base",
520     "//testing/gmock",
521     "//testing/gtest",
522     "//sync",
523   ]
525   defines = [ "SYNC_TEST" ]
526   configs += [ "//build/config/compiler:wexit_time_destructors" ]
529 # GYP version: sync/sync_tests.gypi:test_support_sync_internal_api
530 static_library("test_support_sync_internal_api") {
531   testonly = true
532   sources = [
533     "internal_api/public/test/fake_sync_manager.h",
534     "internal_api/public/test/null_sync_context_proxy.h",
535     "internal_api/public/test/sync_manager_factory_for_profile_sync_test.h",
536     "internal_api/public/test/test_entry_factory.h",
537     "internal_api/public/test/test_internal_components_factory.h",
538     "internal_api/public/test/test_user_share.h",
539     "internal_api/test/fake_sync_manager.cc",
540     "internal_api/test/null_sync_context_proxy.cc",
541     "internal_api/test/sync_manager_factory_for_profile_sync_test.cc",
542     "internal_api/test/sync_manager_for_profile_sync_test.cc",
543     "internal_api/test/sync_manager_for_profile_sync_test.h",
544     "internal_api/test/test_entry_factory.cc",
545     "internal_api/test/test_internal_components_factory.cc",
546     "internal_api/test/test_user_share.cc",
547   ]
549   public_deps = [
550     "//base",
551     "//testing/gtest",
552     "//sync",
553     ":test_support_sync_core",
554   ]
556   defines = [ "SYNC_TEST" ]
557   configs += [ "//build/config/compiler:wexit_time_destructors" ]
560 # GYP version: sync/sync_tests.gypi:test_support_sync_api
561 static_library("test_support_sync_api") {
562   testonly = true
563   sources = [
564     "api/fake_sync_change_processor.cc",
565     "api/fake_sync_change_processor.h",
566     "api/fake_syncable_service.cc",
567     "api/fake_syncable_service.h",
568     "api/sync_change_processor_wrapper_for_test.cc",
569     "api/sync_change_processor_wrapper_for_test.h",
570     "api/sync_error_factory_mock.cc",
571     "api/sync_error_factory_mock.h",
572   ]
574   defines = [ "SYNC_TEST" ]
576   public_deps = [
577     "//base",
578     "//sync",
579     "//testing/gmock",
580   ]
583 # TODO(GYP): Delete this after we've converted everything to GN.
584 # The _run targets exist only for compatibility w/ GYP.
585 group("sync_unit_tests_run") {
586   testonly = true
587   deps = [
588     ":sync_unit_tests",
589   ]
592 # GYP version: sync/sync_tests.gypi:sync_unit_tests
593 test("sync_unit_tests") {
594   sources = [
595     "api/attachments/attachment_id_unittest.cc",
596     "api/attachments/attachment_metadata_unittest.cc",
597     "api/attachments/attachment_unittest.cc",
598     "api/sync_change_unittest.cc",
599     "api/sync_data_unittest.cc",
600     "api/sync_error_unittest.cc",
601     "api/sync_merge_result_unittest.cc",
602     "engine/apply_control_data_updates_unittest.cc",
603     "engine/backoff_delay_provider_unittest.cc",
604     "engine/directory_commit_contribution_unittest.cc",
605     "engine/directory_update_handler_unittest.cc",
606     "engine/entity_tracker_unittest.cc",
607     "engine/get_updates_processor_unittest.cc",
608     "engine/model_type_entity_unittest.cc",
609     "engine/model_type_processor_impl_unittest.cc",
610     "engine/model_type_sync_worker_impl_unittest.cc",
611     "engine/sync_scheduler_unittest.cc",
612     "engine/syncer_proto_util_unittest.cc",
613     "engine/syncer_unittest.cc",
614     "engine/syncer_util_unittest.cc",
615     "internal_api/attachments/attachment_downloader_impl_unittest.cc",
616     "internal_api/attachments/attachment_service_impl_unittest.cc",
617     "internal_api/attachments/attachment_service_proxy_unittest.cc",
618     "internal_api/attachments/attachment_store_frontend_unittest.cc",
619     "internal_api/attachments/attachment_store_test_template.h",
620     "internal_api/attachments/attachment_uploader_impl_unittest.cc",
621     "internal_api/attachments/fake_attachment_downloader_unittest.cc",
622     "internal_api/attachments/fake_attachment_uploader_unittest.cc",
623     "internal_api/attachments/in_memory_attachment_store_unittest.cc",
624     "internal_api/attachments/on_disk_attachment_store_unittest.cc",
625     "internal_api/attachments/task_queue_unittest.cc",
626     "internal_api/debug_info_event_listener_unittest.cc",
627     "internal_api/http_bridge_unittest.cc",
628     "internal_api/js_mutation_event_observer_unittest.cc",
629     "internal_api/js_sync_encryption_handler_observer_unittest.cc",
630     "internal_api/js_sync_manager_observer_unittest.cc",
631     "internal_api/protocol_event_buffer_unittest.cc",
632     "internal_api/public/base/attachment_id_proto_unittest.cc",
633     "internal_api/public/base/cancelation_signal_unittest.cc",
634     "internal_api/public/base/enum_set_unittest.cc",
635     "internal_api/public/base/node_ordinal_unittest.cc",
636     "internal_api/public/base/ordinal_unittest.cc",
637     "internal_api/public/base/unique_position_unittest.cc",
638     "internal_api/public/change_record_unittest.cc",
639     "internal_api/public/engine/model_safe_worker_unittest.cc",
640     "internal_api/public/sessions/sync_session_snapshot_unittest.cc",
641     "internal_api/public/util/immutable_unittest.cc",
642     "internal_api/public/util/weak_handle_unittest.cc",
643     "internal_api/sync_backup_manager_unittest.cc",
644     "internal_api/sync_context_proxy_impl_unittest.cc",
645     "internal_api/sync_encryption_handler_impl_unittest.cc",
646     "internal_api/sync_manager_impl_unittest.cc",
647     "internal_api/sync_rollback_manager_base_unittest.cc",
648     "internal_api/sync_rollback_manager_unittest.cc",
649     "internal_api/syncapi_server_connection_manager_unittest.cc",
650     "js/js_event_details_unittest.cc",
651     "js/sync_js_controller_unittest.cc",
652     "protocol/proto_enum_conversions_unittest.cc",
653     "protocol/proto_value_conversions_unittest.cc",
654     "sessions/model_type_registry_unittest.cc",
655     "sessions/nudge_tracker_unittest.cc",
656     "sessions/status_controller_unittest.cc",
657     "syncable/deferred_on_disk_directory_backing_store_unittest.cc",
658     "syncable/directory_backing_store_unittest.cc",
659     "syncable/directory_unittest.cc",
660     "syncable/directory_unittest.h",
661     "syncable/entry_kernel_unittest.cc",
662     "syncable/model_type_unittest.cc",
663     "syncable/nigori_util_unittest.cc",
664     "syncable/parent_child_index_unittest.cc",
665     "syncable/proto_value_ptr_unittest.cc",
666     "syncable/syncable_enum_conversions_unittest.cc",
667     "syncable/syncable_id_unittest.cc",
668     "syncable/syncable_unittest.cc",
669     "syncable/syncable_util_unittest.cc",
670     "util/cryptographer_unittest.cc",
671     "util/data_type_histogram_unittest.cc",
672     "util/get_session_name_unittest.cc",
673     "util/nigori_unittest.cc",
674     "util/protobuf_unittest.cc",
675   ]
677   configs += [ "//build/config:precompiled_headers" ]
679   data = [
680     "//chrome/test/data/sync/",
681     "//net/tools/testserver/",
682     "//third_party/pyftpdlib/",
683     "//third_party/pywebsocket/",
684     "//third_party/tlslite/",
685     "$root_out_dir/pyproto/google/",
686   ]
688   if (is_android) {
689     data += [ "$root_out_dir/locales/en-US.pak" ]
690   }
692   deps = [
693     ":test_support_sync_core",
694     ":test_support_sync_internal_api",
695     "//base",
696     "//base/allocator",
697     "//base/test:run_all_unittests",
698     "//google_apis",
699     "//google_apis:test_support",
700     "//net",
701     "//net:test_support",
702     "//sql",
703     "//sql:test_support",
704     "//sync",
705     "//sync/protocol",
706     "//testing/gmock",
707     "//testing/gtest",
708     "//third_party/leveldatabase",
709     "//third_party/protobuf:protobuf_lite",
710     "//third_party/zlib",
711   ]
713   if (is_android) {
714     isolate_file = "sync_unit_tests.isolate"
715   }
717   if (is_chromeos) {
718     # Required by get_session_name_unittest.cc on Chrome OS.
719     deps += [ "//chromeos" ]
720   }
722   if (is_ios) {
723     sources -= [ "internal_api/http_bridge_unittest.cc" ]
724   }
726   defines = [ "SYNC_TEST" ]
729 # GYP version: sync/sync_tests.gypi:test_support_sync_fake_server
730 static_library("test_support_sync_fake_server") {
731   testonly = true
732   sources = [
733     "test/fake_server/bookmark_entity.cc",
734     "test/fake_server/bookmark_entity.h",
735     "test/fake_server/bookmark_entity_builder.cc",
736     "test/fake_server/bookmark_entity_builder.h",
737     "test/fake_server/entity_builder_factory.cc",
738     "test/fake_server/entity_builder_factory.h",
739     "test/fake_server/fake_server.cc",
740     "test/fake_server/fake_server.h",
741     "test/fake_server/fake_server_entity.cc",
742     "test/fake_server/fake_server_entity.h",
743     "test/fake_server/fake_server_http_post_provider.cc",
744     "test/fake_server/fake_server_http_post_provider.h",
745     "test/fake_server/fake_server_network_resources.cc",
746     "test/fake_server/fake_server_network_resources.h",
747     "test/fake_server/fake_server_verifier.cc",
748     "test/fake_server/fake_server_verifier.h",
749     "test/fake_server/permanent_entity.cc",
750     "test/fake_server/permanent_entity.h",
751     "test/fake_server/sessions_hierarchy.cc",
752     "test/fake_server/sessions_hierarchy.h",
753     "test/fake_server/tombstone_entity.cc",
754     "test/fake_server/tombstone_entity.h",
755     "test/fake_server/unique_client_entity.cc",
756     "test/fake_server/unique_client_entity.h",
757   ]
759   deps = [
760     "//base",
761     "//net",
762     "//testing/gtest",
763     "//third_party/protobuf:protobuf_lite",
764     "//sync",
765     "//url",
766   ]
768   forward_dependent_configs_from = [ "//third_party/protobuf:protobuf_lite" ]
770   configs += [ "//build/config/compiler:wexit_time_destructors" ]
773 # GYP version: sync/sync_tests.gypi:test_support_sync_testserver
774 static_library("test_support_sync_testserver") {
775   testonly = true
776   sources = [
777     "test/local_sync_test_server.cc",
778     "test/local_sync_test_server.h",
779   ]
781   configs += [ "//build/config/compiler:wexit_time_destructors" ]
783   public_deps = [
784     "//base",
785     "//net:test_support",
786   ]
787   deps = [
788     ":sync",
789     # The sync test server uses Python modules generated by the sync protos.
790     #  '../third_party/protobuf/protobuf.gyp:py_proto',  # TODO(GYP)
791   ]
794 if (!is_ios) {
795   # GYP version: sync/sync_tests.gypi:run_sync_testserver
796   executable("run_sync_testserver") {
797     testonly = true
798     sources = [
799       "tools/testserver/run_sync_testserver.cc",
800     ]
802     deps = [
803       ":test_support_sync_testserver",
804       "//base",
805       "//base/test:test_support",
806       "//build/config/sanitizers:deps",
807       "//net:test_support",
808       "//testing/gtest",
809     ]
810   }
813 if (is_android) {
814   import("//build/config/android/rules.gni")
816   # GYP: //sync/sync_tests.gypi:fake_server_jni
817   generate_jni("fake_server_jni") {
818     testonly = true
819     jni_package = "sync/test/fake_server"
820     sources = [
821       "//chrome/android/sync_shell/javatests/src/org/chromium/chrome/browser/sync/FakeServerHelper.java",
822     ]
823   }
825   # GYP: //sync/sync_tests.gypi:sync_java_test_support
826   android_library("sync_java_test_support") {
827     testonly = true
828     deps = [
829       "android:sync_java",
830       "//base:base_java",
831       "//base:base_java_test_support",
832       "//third_party/jsr-305:jsr_305_javalib",
833     ]
834     DEPRECATED_java_in_dir = "test/android/javatests/src"
835   }
837   # GYP: //sync/sync_tests.gypi:test_support_sync_fake_server_android
838   static_library("test_support_sync_fake_server_android") {
839     testonly = true
840     sources = [
841       "test/fake_server/android/fake_server_helper_android.cc",
842       "test/fake_server/android/fake_server_helper_android.h",
843     ]
844     deps = [
845       ":fake_server_jni",
846       ":sync_core",
847       ":test_support_sync_fake_server",
848       "//base",
849       "//sync/protocol:protocol",
850       "//testing/gtest",
851       "//url:url",
852     ]
853   }