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