Add assets for close buttons in overview.
[chromium-blink-merge.git] / sync / sync_tests.gypi
blobd3d85621cdc975ff6bf91ea248756de69cef5834
1 # Copyright 2013 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.
6   'targets': [
7     # Test support files for the 'sync_core' target.
8     {
9       'target_name': 'test_support_sync_core',
10       'type': 'static_library',
11       'variables': { 'enable_wexit_time_destructors': 1, },
12       'include_dirs': [
13         '..',
14       ],
15       'defines': [
16         'SYNC_TEST'
17       ],
18       'dependencies': [
19         '../base/base.gyp:base',
20         '../testing/gmock.gyp:gmock',
21         '../testing/gtest.gyp:gtest',
22         'sync',
23       ],
24       'export_dependent_settings': [
25         '../testing/gmock.gyp:gmock',
26         '../testing/gtest.gyp:gtest',
27         'sync',
28       ],
29       'sources': [
30         'internal_api/public/base/model_type_test_util.cc',
31         'internal_api/public/base/model_type_test_util.h',
32         'js/js_test_util.cc',
33         'js/js_test_util.h',
34         'sessions/test_util.cc',
35         'sessions/test_util.h',
36         'test/callback_counter.h',
37         'test/engine/fake_model_worker.cc',
38         'test/engine/fake_model_worker.h',
39         'test/engine/fake_sync_scheduler.cc',
40         'test/engine/fake_sync_scheduler.h',
41         'test/engine/mock_connection_manager.cc',
42         'test/engine/mock_connection_manager.h',
43         'test/engine/mock_update_handler.cc',
44         'test/engine/mock_update_handler.h',
45         'test/engine/test_directory_setter_upper.cc',
46         'test/engine/test_directory_setter_upper.h',
47         'test/engine/test_id_factory.h',
48         'test/engine/test_syncable_utils.cc',
49         'test/engine/test_syncable_utils.h',
50         'test/fake_encryptor.cc',
51         'test/fake_encryptor.h',
52         'test/fake_sync_encryption_handler.cc',
53         'test/fake_sync_encryption_handler.h',
54         'test/null_directory_change_delegate.cc',
55         'test/null_directory_change_delegate.h',
56         'test/null_transaction_observer.cc',
57         'test/null_transaction_observer.h',
58         'test/sessions/test_scoped_session_event_listener.h',
59         'test/sessions/mock_debug_info_getter.h',
60         'test/sessions/mock_debug_info_getter.cc',
61         'test/test_directory_backing_store.cc',
62         'test/test_directory_backing_store.h',
63         'test/test_transaction_observer.cc',
64         'test/test_transaction_observer.h',
65         'util/test_unrecoverable_error_handler.cc',
66         'util/test_unrecoverable_error_handler.h',
67       ],
68     },
70     # Test support files for the python sync test server.
71     {
72       'target_name': 'test_support_sync_testserver',
73       'type': 'static_library',
74       'variables': { 'enable_wexit_time_destructors': 1, },
75       'include_dirs': [
76         '..',
77       ],
78       'dependencies': [
79         '../base/base.gyp:base',
80         '../net/net.gyp:net_test_support',
81         # The sync test server uses Python modules generated by the sync protos.
82         '../third_party/protobuf/protobuf.gyp:py_proto',
83         'sync',
84       ],
85       'export_dependent_settings': [
86         '../base/base.gyp:base',
87         '../net/net.gyp:net_test_support',
88       ],
89       'sources': [
90         'test/local_sync_test_server.cc',
91         'test/local_sync_test_server.h',
92       ],
93     },
95     # Test support files for the fake sync server.
96     {
97       'target_name': 'test_support_sync_fake_server',
98       'type': 'static_library',
99       'variables': { 'enable_wexit_time_destructors': 1, },
100       'include_dirs': [
101         '..',
102       ],
103       'dependencies': [
104         '../base/base.gyp:base',
105         '../net/net.gyp:net',
106         'sync',
107       ],
108       'export_dependent_settings': [
109         'sync',
110       ],
111       'sources': [
112         'test/fake_server/bookmark_entity.cc',
113         'test/fake_server/bookmark_entity.h',
114         'test/fake_server/fake_server.cc',
115         'test/fake_server/fake_server.h',
116         'test/fake_server/fake_server_entity.cc',
117         'test/fake_server/fake_server_entity.h',
118         'test/fake_server/fake_server_http_post_provider.cc',
119         'test/fake_server/fake_server_http_post_provider.h',
120         'test/fake_server/fake_server_network_resources.cc',
121         'test/fake_server/fake_server_network_resources.h',
122         'test/fake_server/permanent_entity.cc',
123         'test/fake_server/permanent_entity.h',
124         'test/fake_server/tombstone_entity.cc',
125         'test/fake_server/tombstone_entity.h',
126         'test/fake_server/unique_client_entity.cc',
127         'test/fake_server/unique_client_entity.h',
128       ],
129     },
131     # Test support files for the 'sync_notifier' target.
132     {
133       'target_name': 'test_support_sync_notifier',
134       'type': 'static_library',
135       'include_dirs': [
136         '..',
137       ],
138       'defines': [
139         'SYNC_TEST'
140       ],
141       'dependencies': [
142         '../testing/gmock.gyp:gmock',
143         '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_proto_cpp',
144         'sync',
145       ],
146       'export_dependent_settings': [
147         '../testing/gmock.gyp:gmock',
148         '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation_proto_cpp',
149         'sync',
150       ],
151       'sources': [
152         'notifier/fake_invalidation_handler.cc',
153         'notifier/fake_invalidation_handler.h',
154         'notifier/fake_invalidation_state_tracker.cc',
155         'notifier/fake_invalidation_state_tracker.h',
156         'notifier/fake_invalidator.cc',
157         'notifier/fake_invalidator.h',
158         'notifier/invalidator_test_template.cc',
159         'notifier/invalidator_test_template.h',
160         'notifier/unacked_invalidation_set_test_util.cc',
161         'notifier/unacked_invalidation_set_test_util.h',
162         'internal_api/public/base/object_id_invalidation_map_test_util.h',
163         'internal_api/public/base/object_id_invalidation_map_test_util.cc',
164       ],
165     },
167     # Test support files for the 'sync_internal_api' target.
168     {
169       'target_name': 'test_support_sync_internal_api',
170       'type': 'static_library',
171       'variables': { 'enable_wexit_time_destructors': 1, },
172       'include_dirs': [
173         '..',
174       ],
175       'defines': [
176         'SYNC_TEST'
177       ],
178       'dependencies': [
179         '../base/base.gyp:base',
180         '../testing/gtest.gyp:gtest',
181         'sync',
182         'test_support_sync_core',
183       ],
184       'export_dependent_settings': [
185         '../testing/gtest.gyp:gtest',
186         'sync',
187         'test_support_sync_core',
188       ],
189       'sources': [
190         'internal_api/public/base/invalidation_test_util.cc',
191         'internal_api/public/base/invalidation_test_util.h',
192         'internal_api/public/test/fake_sync_manager.h',
193         'internal_api/public/test/sync_manager_factory_for_profile_sync_test.h',
194         'internal_api/public/test/test_entry_factory.h',
195         'internal_api/public/test/test_internal_components_factory.h',
196         'internal_api/public/test/test_user_share.h',
197         'internal_api/test/fake_sync_manager.cc',
198         'internal_api/test/sync_manager_factory_for_profile_sync_test.cc',
199         'internal_api/test/sync_manager_for_profile_sync_test.cc',
200         'internal_api/test/sync_manager_for_profile_sync_test.h',
201         'internal_api/test/test_entry_factory.cc',
202         'internal_api/test/test_internal_components_factory.cc',
203         'internal_api/test/test_user_share.cc',
204       ],
205     },
207     # Test support files for the 'sync_api' target.
208     {
209       'target_name': 'test_support_sync_api',
210       'type': 'static_library',
211       'include_dirs': [
212         '..',
213       ],
214       'defines': [
215         'SYNC_TEST'
216       ],
217       'dependencies': [
218         '../testing/gmock.gyp:gmock',
219         'sync',
220       ],
221       'export_dependent_settings': [
222         '../testing/gmock.gyp:gmock',
223         'sync',
224       ],
225       'sources': [
226         'api/fake_syncable_service.cc',
227         'api/fake_syncable_service.h',
228         'api/fake_sync_change_processor.cc',
229         'api/fake_sync_change_processor.h',
230         'api/sync_change_processor_wrapper_for_test.cc',
231         'api/sync_change_processor_wrapper_for_test.h',
232         'api/sync_error_factory_mock.cc',
233         'api/sync_error_factory_mock.h',
234       ],
235     },
237     # Unit tests for the 'sync_core' target.  This cannot be a static
238     # library because the unit test files have to be compiled directly
239     # into the executable, so we push the target files to the
240     # depending executable target via direct_dependent_settings.
241     {
242       'target_name': 'sync_core_tests',
243       'type': 'none',
244       # We only want unit test executables to include this target.
245       'suppress_wildcard': 1,
246       'dependencies': [
247         '../base/base.gyp:base',
248         '../sql/sql.gyp:sql',
249         '../testing/gmock.gyp:gmock',
250         '../testing/gtest.gyp:gtest',
251         'sync',
252         'test_support_sync_core',
253       ],
254       'conditions': [
255         ['OS=="linux" and chromeos==1', {
256           # Required by get_session_name_unittest.cc on Chrome OS.
257           'dependencies': [
258             '../chromeos/chromeos.gyp:chromeos',
259           ],
260         }],
261       ],
262       # Propagate all dependencies since the actual compilation
263       # happens in the dependents.
264       'export_dependent_settings': [
265         '../base/base.gyp:base',
266         '../sql/sql.gyp:sql',
267         '../testing/gmock.gyp:gmock',
268         '../testing/gtest.gyp:gtest',
269         'sync',
270         'test_support_sync_core',
271       ],
272       'direct_dependent_settings': {
273         'include_dirs': [
274           '..',
275         ],
276         'sources': [
277           'internal_api/public/base/cancelation_signal_unittest.cc',
278           'internal_api/public/base/enum_set_unittest.cc',
279           'internal_api/public/base/node_ordinal_unittest.cc',
280           'internal_api/public/base/ordinal_unittest.cc',
281           'internal_api/public/base/unique_position_unittest.cc',
282           'internal_api/public/engine/model_safe_worker_unittest.cc',
283           'internal_api/public/util/immutable_unittest.cc',
284           'internal_api/public/util/weak_handle_unittest.cc',
285           'engine/apply_control_data_updates_unittest.cc',
286           'engine/backoff_delay_provider_unittest.cc',
287           'engine/directory_commit_contribution_unittest.cc',
288           'engine/directory_update_handler_unittest.cc',
289           'engine/get_updates_processor_unittest.cc',
290           'engine/sync_scheduler_unittest.cc',
291           'engine/syncer_proto_util_unittest.cc',
292           'engine/syncer_unittest.cc',
293           'engine/traffic_recorder_unittest.cc',
294           'js/js_arg_list_unittest.cc',
295           'js/js_event_details_unittest.cc',
296           'js/sync_js_controller_unittest.cc',
297           'protocol/proto_enum_conversions_unittest.cc',
298           'protocol/proto_value_conversions_unittest.cc',
299           'sessions/model_type_registry_unittest.cc',
300           'sessions/nudge_tracker_unittest.cc',
301           'sessions/status_controller_unittest.cc',
302           'syncable/directory_backing_store_unittest.cc',
303           'syncable/model_type_unittest.cc',
304           'syncable/nigori_util_unittest.cc',
305           'syncable/parent_child_index_unittest.cc',
306           'syncable/syncable_enum_conversions_unittest.cc',
307           'syncable/syncable_id_unittest.cc',
308           'syncable/syncable_unittest.cc',
309           'syncable/syncable_util_unittest.cc',
310           'util/cryptographer_unittest.cc',
311           'util/data_type_histogram_unittest.cc',
312           'util/get_session_name_unittest.cc',
313           'util/nigori_unittest.cc',
314           'util/protobuf_unittest.cc',
315         ],
316       },
317     },
319     # Unit tests for the 'sync_notifier' target.  This cannot be a static
320     # library because the unit test files have to be compiled directly
321     # into the executable, so we push the target files to the
322     # depending executable target via direct_dependent_settings.
323     {
324       'target_name': 'sync_notifier_tests',
325       'type': 'none',
326       # We only want unit test executables to include this target.
327       'suppress_wildcard': 1,
328       'dependencies': [
329         '../base/base.gyp:base',
330         '../google_apis/google_apis.gyp:google_apis',
331         '../jingle/jingle.gyp:notifier_test_util',
332         '../net/net.gyp:net_test_support',
333         '../testing/gmock.gyp:gmock',
334         '../testing/gtest.gyp:gtest',
335         '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation',
336         '../third_party/libjingle/libjingle.gyp:libjingle',
337         'sync',
338         'test_support_sync_notifier',
339       ],
340       # Propagate all dependencies since the actual compilation
341       # happens in the dependents.
342       'export_dependent_settings': [
343         '../base/base.gyp:base',
344         '../google_apis/google_apis.gyp:google_apis',
345         '../jingle/jingle.gyp:notifier_test_util',
346         '../net/net.gyp:net_test_support',
347         '../testing/gmock.gyp:gmock',
348         '../testing/gtest.gyp:gtest',
349         '../third_party/cacheinvalidation/cacheinvalidation.gyp:cacheinvalidation',
350         '../third_party/libjingle/libjingle.gyp:libjingle',
351         'sync',
352         'test_support_sync_notifier',
353       ],
354       'direct_dependent_settings': {
355         'include_dirs': [
356           '..',
357         ],
358         'conditions': [
359           ['OS != "android"', {
360             'sources': [
361               'notifier/fake_invalidator_unittest.cc',
362               'notifier/gcm_network_channel_unittest.cc',
363               'notifier/invalidation_notifier_unittest.cc',
364               'notifier/invalidator_registrar_unittest.cc',
365               'notifier/non_blocking_invalidator_unittest.cc',
366               'notifier/object_id_invalidation_map_unittest.cc',
367               'notifier/p2p_invalidator_unittest.cc',
368               'notifier/push_client_channel_unittest.cc',
369               'notifier/registration_manager_unittest.cc',
370               'notifier/single_object_invalidation_set_unittest.cc',
371               'notifier/sync_invalidation_listener_unittest.cc',
372               'notifier/sync_system_resources_unittest.cc',
373               'notifier/unacked_invalidation_set_unittest.cc',
374             ],
375           }],
376         ],
377       },
378     },
380     # Unit tests for the 'sync_internal_api' target.  This cannot be a static
381     # library because the unit test files have to be compiled directly
382     # into the executable, so we push the target files to the
383     # depending executable target via direct_dependent_settings.
384     {
385       'target_name': 'sync_internal_api_tests',
386       'type': 'none',
387       # We only want unit test executables to include this target.
388       'suppress_wildcard': 1,
389       'dependencies': [
390         '../base/base.gyp:base',
391         '../net/net.gyp:net',
392         '../net/net.gyp:net_test_support',
393         '../testing/gmock.gyp:gmock',
394         '../testing/gtest.gyp:gtest',
395         'sync',
396         'test_support_sync_internal_api',
397       ],
398       # Propagate all dependencies since the actual compilation
399       # happens in the dependents.
400       'export_dependent_settings': [
401         '../base/base.gyp:base',
402         '../net/net.gyp:net',
403         '../net/net.gyp:net_test_support',
404         '../testing/gmock.gyp:gmock',
405         '../testing/gtest.gyp:gtest',
406         'sync',
407         'test_support_sync_internal_api',
408       ],
409       'direct_dependent_settings': {
410         'include_dirs': [
411           '..',
412         ],
413         'sources': [
414           'internal_api/debug_info_event_listener_unittest.cc',
415           'internal_api/http_bridge_unittest.cc',
416           'internal_api/js_mutation_event_observer_unittest.cc',
417           'internal_api/js_sync_encryption_handler_observer_unittest.cc',
418           'internal_api/js_sync_manager_observer_unittest.cc',
419           'internal_api/public/change_record_unittest.cc',
420           'internal_api/public/sessions/sync_session_snapshot_unittest.cc',
421           'internal_api/syncapi_server_connection_manager_unittest.cc',
422           'internal_api/sync_encryption_handler_impl_unittest.cc',
423           'internal_api/sync_manager_impl_unittest.cc',
424         ],
425         'conditions': [
426           ['OS == "ios"', {
427             'sources!': [
428               'internal_api/http_bridge_unittest.cc',
429             ],
430           }],
431         ],
432       },
433     },
435     # Unit tests for the 'sync_api' target.  This cannot be a static
436     # library because the unit test files have to be compiled directly
437     # into the executable, so we push the target files to the
438     # depending executable target via direct_dependent_settings.
439     {
440       'target_name': 'sync_api_tests',
441       'type': 'none',
442       # We only want unit test executables to include this target.
443       'suppress_wildcard': 1,
444       'dependencies': [
445         '../base/base.gyp:base',
446         '../testing/gtest.gyp:gtest',
447         'sync',
448         'test_support_sync_internal_api',
449       ],
450       # Propagate all dependencies since the actual compilation
451       # happens in the dependents.
452       'export_dependent_settings': [
453         '../base/base.gyp:base',
454         '../testing/gtest.gyp:gtest',
455         'sync',
456         'test_support_sync_internal_api',
457       ],
458       'direct_dependent_settings': {
459         'include_dirs': [
460           '..',
461         ],
462         'sources': [
463           'api/attachments/attachment_unittest.cc',
464           'api/attachments/fake_attachment_store_unittest.cc',
465           'api/sync_change_unittest.cc',
466           'api/sync_data_unittest.cc',
467           'api/sync_error_unittest.cc',
468           'api/sync_merge_result_unittest.cc',
469         ],
470       },
471     },
473     # The unit test executable for sync tests.
474     {
475       'target_name': 'sync_unit_tests',
476       'type': '<(gtest_target_type)',
477       # Typed-parametrized tests generate exit-time destructors.
478       'variables': { 'enable_wexit_time_destructors': 0, },
479       'defines': [
480         'SYNC_TEST',
481       ],
482       'dependencies': [
483         '../base/base.gyp:run_all_unittests',
484         'sync_api_tests',
485         'sync_core_tests',
486         'sync_internal_api_tests',
487         'sync_notifier_tests',
488       ],
489       'conditions': [
490         # TODO(akalin): This is needed because histogram.cc uses
491         # leak_annotations.h, which pulls this in.  Make 'base'
492         # propagate this dependency.
493         # TODO(dmikurube): Kill linux_use_tcmalloc. http://crbug.com/345554
494         ['OS=="linux" and ((use_allocator!="none" and use_allocator!="see_use_tcmalloc") or (use_allocator=="see_use_tcmalloc" and linux_use_tcmalloc==1))', {
495           'dependencies': [
496             '../base/allocator/allocator.gyp:allocator',
497           ],
498         }],
499         ['OS == "android" and gtest_target_type == "shared_library"', {
500           'dependencies': [
501             '../testing/android/native_test.gyp:native_test_native_code',
502           ],
503         }],
504       ],
505     },
507     # Test support files for using the Test Accounts service.
508     {
509       'target_name': 'test_support_accounts_client',
510       'type': 'static_library',
511       'direct_dependent_settings': {
512         'include_dirs': [
513           '..',
514         ],
515       },
516       'dependencies': [
517         '../base/base.gyp:base',
518         '../net/net.gyp:net',
519       ],
520       'sources': [
521         'test/accounts_client/test_accounts_client.cc',
522         'test/accounts_client/test_accounts_client.h',
523         'test/accounts_client/url_request_context_getter.cc',
524         'test/accounts_client/url_request_context_getter.h',
525       ],
526     },
528     # The Sync end-to-end (and associated infrastructure) tests.
529     {
530       'target_name': 'sync_endtoend_tests',
531       'type': '<(gtest_target_type)',
532       'dependencies': [
533         '../base/base.gyp:run_all_unittests',
534         '../testing/gmock.gyp:gmock',
535         '../testing/gtest.gyp:gtest',
536         '../url/url.gyp:url_lib',
537         'test_support_accounts_client',
538       ],
539       'sources': [
540         'test/accounts_client/test_accounts_client_unittest.cc',
541       ],
542     },
544   ],
545   'conditions': [
546     ['OS != "ios"', {
547       'targets': [
548         {
549           'target_name': 'sync_tools_helper',
550           'type': 'static_library',
551           'defines': [
552             'SYNC_IMPLEMENTATION',
553           ],
554           'include_dirs': [
555             '..',
556           ],
557           'dependencies': [
558             '../base/base.gyp:base',
559             'sync',
560           ],
561           'export_dependent_settings': [
562             '../base/base.gyp:base',
563             'sync',
564           ],
565           'sources': [
566             'tools/null_invalidation_state_tracker.cc',
567             'tools/null_invalidation_state_tracker.h',
568           ],
569         },
571         # A tool that can be used to launch a python sync server instance.
572         {
573           'target_name': 'run_sync_testserver',
574           'type': 'executable',
575           'dependencies': [
576             '../base/base.gyp:base',
577             '../base/base.gyp:test_support_base',
578             '../net/net.gyp:net_test_support',
579             '../testing/gtest.gyp:gtest',
580             'test_support_sync_testserver',
581           ],
582           'sources': [
583             'tools/testserver/run_sync_testserver.cc',
584           ],
585         },
587         # A tool to listen to sync notifications and print them out.
588         {
589           'target_name': 'sync_listen_notifications',
590           'type': 'executable',
591           'defines': [
592             'SYNC_TEST',
593           ],
594           'dependencies': [
595             '../base/base.gyp:base',
596             '../jingle/jingle.gyp:notifier',
597             '../net/net.gyp:net',
598             '../net/net.gyp:net_test_support',
599             'sync',
600             'sync_tools_helper',
601           ],
602           'sources': [
603             'tools/sync_listen_notifications.cc',
604           ],
605         },
607         # A standalone command-line sync client.
608         {
609           'target_name': 'sync_client',
610           'type': 'executable',
611           'defines': [
612             'SYNC_TEST',
613           ],
614           'dependencies': [
615             '../base/base.gyp:base',
616             '../jingle/jingle.gyp:notifier',
617             '../net/net.gyp:net',
618             '../net/net.gyp:net_test_support',
619             'sync',
620             'sync_tools_helper',
621             'test_support_sync_core'
622           ],
623           'sources': [
624             'tools/sync_client.cc',
625           ],
626         },
627       ],
628     }],
629     ['OS == "android"', {
630       'targets': [
631         {
632           'target_name': 'sync_javatests',
633           'type': 'none',
634           'variables': {
635             'java_in_dir': '../sync/android/javatests',
636           },
637           'dependencies': [
638             'sync_java',
639             'sync_java_test_support',
640             '../base/base.gyp:base_java_test_support',
641           ],
642           'includes': [ '../build/java.gypi' ],
643         },
644         {
645           'target_name': 'sync_java_test_support',
646           'type': 'none',
647           'variables': {
648             'package_name': 'sync_java_test_support',
649             'java_in_dir': '../sync/test/android/javatests',
650           },
651           'dependencies': [
652             'sync_java',
653           ],
654           'includes': [ '../build/java.gypi' ],
655         },
656       ],
657     }],
658     # Special target to wrap a gtest_target_type==shared_library
659     # sync_unit_tests into an android apk for execution.
660     ['OS == "android" and gtest_target_type == "shared_library"', {
661       'targets': [
662         {
663           'target_name': 'sync_unit_tests_apk',
664           'type': 'none',
665           'dependencies': [
666             'sync_unit_tests',
667           ],
668           'variables': {
669             'test_suite_name': 'sync_unit_tests',
670             'input_shlib_path': '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)sync_unit_tests<(SHARED_LIB_SUFFIX)',
671           },
672           'includes': [ '../build/apk_test.gypi' ],
673         },
674       ],
675     }],
676   ],