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