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