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