Upstream version 5.34.92.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/sync_attachment_unittest.cc',
450           'api/sync_change_unittest.cc',
451           'api/sync_error_unittest.cc',
452           'api/sync_merge_result_unittest.cc',
453         ],
454       },
455     },
456
457     # The unit test executable for sync tests.
458     {
459       'target_name': 'sync_unit_tests',
460       'type': '<(gtest_target_type)',
461       # Typed-parametrized tests generate exit-time destructors.
462       'variables': { 'enable_wexit_time_destructors': 0, },
463       'defines': [
464         'SYNC_TEST',
465       ],
466       'dependencies': [
467         '../base/base.gyp:run_all_unittests',
468         'sync_api_tests',
469         'sync_core_tests',
470         'sync_internal_api_tests',
471         'sync_notifier_tests',
472       ],
473       'conditions': [
474         # TODO(akalin): This is needed because histogram.cc uses
475         # leak_annotations.h, which pulls this in.  Make 'base'
476         # propagate this dependency.
477         ['OS=="linux" and linux_use_tcmalloc==1', {
478           'dependencies': [
479             '../base/allocator/allocator.gyp:allocator',
480           ],
481         }],
482         ['OS == "android" and gtest_target_type == "shared_library"', {
483           'dependencies': [
484             '../testing/android/native_test.gyp:native_test_native_code',
485           ],
486         }],
487       ],
488     },
489
490     # Test support files for using the Test Accounts service.
491     {
492       'target_name': 'test_support_accounts_client',
493       'type': 'static_library',
494       'direct_dependent_settings': {
495         'include_dirs': [
496           '..',
497         ],
498       },
499       'dependencies': [
500         '../base/base.gyp:base',
501         '../net/net.gyp:net',
502       ],
503       'sources': [
504         'test/accounts_client/test_accounts_client.cc',
505         'test/accounts_client/test_accounts_client.h',
506         'test/accounts_client/url_request_context_getter.cc',
507         'test/accounts_client/url_request_context_getter.h',
508       ],
509     },
510
511     # The Sync end-to-end (and associated infrastructure) tests.
512     {
513       'target_name': 'sync_endtoend_tests',
514       'type': '<(gtest_target_type)',
515       'dependencies': [
516         '../base/base.gyp:run_all_unittests',
517         '../testing/gmock.gyp:gmock',
518         '../testing/gtest.gyp:gtest',
519         '../url/url.gyp:url_lib',
520         'test_support_accounts_client',
521       ],
522       'sources': [
523         'test/accounts_client/test_accounts_client_unittest.cc',
524       ],
525     },
526
527   ],
528   'conditions': [
529     ['OS != "ios"', {
530       'targets': [
531         {
532           'target_name': 'sync_tools_helper',
533           'type': 'static_library',
534           'defines': [
535             'SYNC_IMPLEMENTATION',
536           ],
537           'include_dirs': [
538             '..',
539           ],
540           'dependencies': [
541             '../base/base.gyp:base',
542             'sync',
543           ],
544           'export_dependent_settings': [
545             '../base/base.gyp:base',
546             'sync',
547           ],
548           'sources': [
549             'tools/null_invalidation_state_tracker.cc',
550             'tools/null_invalidation_state_tracker.h',
551           ],
552         },
553
554         # A tool that can be used to launch a python sync server instance.
555         {
556           'target_name': 'run_sync_testserver',
557           'type': 'executable',
558           'dependencies': [
559             '../base/base.gyp:base',
560             '../base/base.gyp:test_support_base',
561             '../net/net.gyp:net_test_support',
562             '../testing/gtest.gyp:gtest',
563             'test_support_sync_testserver',
564           ],
565           'sources': [
566             'tools/testserver/run_sync_testserver.cc',
567           ],
568         },
569
570         # A tool to listen to sync notifications and print them out.
571         {
572           'target_name': 'sync_listen_notifications',
573           'type': 'executable',
574           'defines': [
575             'SYNC_TEST',
576           ],
577           'dependencies': [
578             '../base/base.gyp:base',
579             '../jingle/jingle.gyp:notifier',
580             '../net/net.gyp:net',
581             '../net/net.gyp:net_test_support',
582             'sync',
583             'sync_tools_helper',
584           ],
585           'sources': [
586             'tools/sync_listen_notifications.cc',
587           ],
588         },
589
590         # A standalone command-line sync client.
591         {
592           'target_name': 'sync_client',
593           'type': 'executable',
594           'defines': [
595             'SYNC_TEST',
596           ],
597           'dependencies': [
598             '../base/base.gyp:base',
599             '../jingle/jingle.gyp:notifier',
600             '../net/net.gyp:net',
601             '../net/net.gyp:net_test_support',
602             'sync',
603             'sync_tools_helper',
604             'test_support_sync_core'
605           ],
606           'sources': [
607             'tools/sync_client.cc',
608           ],
609         },
610       ],
611     }],
612     ['OS == "android"', {
613       'targets': [
614         {
615           'target_name': 'sync_javatests',
616           'type': 'none',
617           'variables': {
618             'java_in_dir': '../sync/android/javatests',
619           },
620           'dependencies': [
621             'sync_java',
622             'sync_java_test_support',
623             '../base/base.gyp:base_java_test_support',
624           ],
625           'includes': [ '../build/java.gypi' ],
626         },
627         {
628           'target_name': 'sync_java_test_support',
629           'type': 'none',
630           'variables': {
631             'package_name': 'sync_java_test_support',
632             'java_in_dir': '../sync/test/android/javatests',
633           },
634           'dependencies': [
635             'sync_java',
636           ],
637           'includes': [ '../build/java.gypi' ],
638         },
639       ],
640     }],
641     # Special target to wrap a gtest_target_type==shared_library
642     # sync_unit_tests into an android apk for execution.
643     ['OS == "android" and gtest_target_type == "shared_library"', {
644       'targets': [
645         {
646           'target_name': 'sync_unit_tests_apk',
647           'type': 'none',
648           'dependencies': [
649             'sync_unit_tests',
650           ],
651           'variables': {
652             'test_suite_name': 'sync_unit_tests',
653             'input_shlib_path': '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)sync_unit_tests<(SHARED_LIB_SUFFIX)',
654           },
655           'includes': [ '../build/apk_test.gypi' ],
656         },
657       ],
658     }],
659   ],
660 }