Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / components / components_tests.gyp
1 # Copyright 2012 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   'variables': {
7     # This turns on e.g. the filename-based detection of which
8     # platforms to include source files on (e.g. files ending in
9     # _mac.h or _mac.cc are only compiled on MacOSX).
10     'chromium_code': 1,
11    },
12   'conditions': [
13     ['android_webview_build == 0', {
14       'targets': [
15         {
16           'target_name': 'components_unittests',
17           'type': '<(gtest_target_type)',
18           'sources': [
19             'auto_login_parser/auto_login_parser_unittest.cc',
20             'autofill/core/browser/webdata/autofill_entry_unittest.cc',
21             'autofill/core/browser/webdata/web_data_service_unittest.cc',
22             'autofill/core/common/form_data_unittest.cc',
23             'autofill/core/common/form_field_data_unittest.cc',
24             'autofill/core/common/password_form_fill_data_unittest.cc',
25             'browser_context_keyed_service/browser_context_dependency_manager_unittest.cc',
26             'browser_context_keyed_service/dependency_graph_unittest.cc',
27             'cloud_devices/printer_description_unittest.cc',
28             'dom_distiller/core/article_entry_unittest.cc',
29             'dom_distiller/core/distiller_unittest.cc',
30             'dom_distiller/core/distiller_url_fetcher_unittest.cc',
31             'dom_distiller/core/dom_distiller_database_unittest.cc',
32             'dom_distiller/core/dom_distiller_model_unittest.cc',
33             'dom_distiller/core/dom_distiller_service_unittest.cc',
34             'dom_distiller/core/dom_distiller_store_unittest.cc',
35             'dom_distiller/core/task_tracker_unittest.cc',
36             'json_schema/json_schema_validator_unittest.cc',
37             'json_schema/json_schema_validator_unittest_base.cc',
38             'json_schema/json_schema_validator_unittest_base.h',
39             'language_usage_metrics/language_usage_metrics_unittest.cc',
40             'navigation_interception/intercept_navigation_resource_throttle_unittest.cc',
41             'password_manager/core/browser/login_database_unittest.cc',
42             'password_manager/core/browser/psl_matching_helper_unittest.cc',
43             'password_manager/core/browser/password_store_default_unittest.cc',
44             'password_manager/core/browser/password_store_unittest.cc',
45             'password_manager/core/browser/password_syncable_service_unittest.cc',
46             'precache/content/precache_manager_unittest.cc',
47             'precache/core/precache_database_unittest.cc',
48             'precache/core/precache_fetcher_unittest.cc',
49             'precache/core/precache_url_table_unittest.cc',
50             'sessions/serialized_navigation_entry_unittest.cc',
51             'signin/core/webdata/token_service_table_unittest.cc',
52             'storage_monitor/image_capture_device_manager_unittest.mm',
53             'storage_monitor/media_storage_util_unittest.cc',
54             'storage_monitor/media_transfer_protocol_device_observer_linux_unittest.cc',
55             'storage_monitor/storage_info_unittest.cc',
56             'storage_monitor/storage_monitor_chromeos_unittest.cc',
57             'storage_monitor/storage_monitor_linux_unittest.cc',
58             'storage_monitor/storage_monitor_mac_unittest.mm',
59             'storage_monitor/storage_monitor_unittest.cc',
60             'storage_monitor/storage_monitor_win_unittest.cc',
61             'sync_driver/model_association_manager_unittest.cc',
62             'sync_driver/system_encryptor_unittest.cc',
63             'test/run_all_unittests.cc',
64             'translate/core/browser/language_state_unittest.cc',
65             'translate/core/browser/translate_browser_metrics_unittest.cc',
66             'translate/core/browser/translate_prefs_unittest.cc',
67             'translate/core/browser/translate_script_unittest.cc',
68             'translate/core/common/translate_metrics_unittest.cc',
69             'translate/core/common/translate_util_unittest.cc',
70             'translate/language_detection/language_detection_util_unittest.cc',
71             'url_matcher/regex_set_matcher_unittest.cc',
72             'url_matcher/string_pattern_unittest.cc',
73             'url_matcher/substring_set_matcher_unittest.cc',
74             'url_matcher/url_matcher_factory_unittest.cc',
75             'url_matcher/url_matcher_unittest.cc',
76             # TODO(asvitkine): These should be tested on iOS too.
77             'variations/entropy_provider_unittest.cc',
78             'variations/metrics_util_unittest.cc',
79             'variations/variations_associated_data_unittest.cc',
80             'variations/variations_seed_processor_unittest.cc',
81             'variations/variations_seed_simulator_unittest.cc',
82             'visitedlink/test/visitedlink_unittest.cc',
83             'webdata/encryptor/encryptor_password_mac_unittest.cc',
84             'webdata/encryptor/encryptor_unittest.cc',
85             'webdata/encryptor/ie7_password_unittest_win.cc',
86             'web_modal/web_contents_modal_dialog_manager_unittest.cc',
87           ],
88           'include_dirs': [
89             '..',
90           ],
91           'dependencies': [
92             '../base/base.gyp:base_prefs_test_support',
93             '../base/base.gyp:test_support_base',
94             # TODO(blundell): Eliminate the need for this dependency in code
95             # that iOS shares. crbug.com/325243
96             '../content/content_shell_and_tests.gyp:test_support_content',
97             '../sync/sync.gyp:sync',
98             '../testing/gmock.gyp:gmock',
99             '../testing/gtest.gyp:gtest',
100             '../ui/gfx/gfx.gyp:gfx',
101             '../ui/ui.gyp:ui',
102
103             # Dependencies of auto_login_parser
104             'components.gyp:auto_login_parser',
105
106             # Dependencies of autofill
107             'components.gyp:autofill_core_browser',
108             'components.gyp:autofill_core_common',
109             'components.gyp:autofill_core_test_support',
110
111             # Dependencies of cloud_devices
112             'components.gyp:cloud_devices',
113
114             # Dependencies of dom_distiller
115             'components.gyp:distilled_page_proto',
116             'components.gyp:dom_distiller_core',
117             'components.gyp:dom_distiller_test_support',
118
119             # Dependencies of encryptor
120             'components.gyp:encryptor',
121
122             # Dependencies of json_schema
123             'components.gyp:json_schema',
124
125             # Dependencies of language_usage_metrics
126             'components.gyp:language_usage_metrics',
127
128             # Dependencies of password_manager
129             'components.gyp:password_manager_core_browser',
130             'components.gyp:password_manager_core_browser_test_support',
131
132             # Dependencies of precache/core
133             'components.gyp:password_manager_core_browser',
134             'components.gyp:precache_core',
135
136             # Dependencies of signin
137             'components.gyp:signin_core',
138
139             # Dependencies of sync_driver
140             'components.gyp:sync_driver_test_support',
141
142             # Dependencies of translate.
143             'components.gyp:translate_core_browser',
144             'components.gyp:translate_core_common',
145             'components.gyp:translate_language_detection',
146
147             # Dependencies of variations
148             'components.gyp:variations',
149           ],
150           'conditions': [
151             ['OS != "ios"', {
152               'dependencies': [
153                 # Dependencies of browser_context_keyed_service
154                 'components.gyp:browser_context_keyed_service',
155
156                 # Dependencies of
157                 # intercept_navigation_resource_throttle_unittest.cc
158                 '../skia/skia.gyp:skia',
159                 'components.gyp:navigation_interception',
160
161                 # Dependencies of precache/content
162                 'components.gyp:precache_content',
163
164                 # Dependencies of sessions
165                 '../third_party/protobuf/protobuf.gyp:protobuf_lite',
166                 'components.gyp:sessions',
167                 'components.gyp:sessions_test_support',
168
169                 # Dependencies of storage monitor
170                 'components.gyp:storage_monitor',
171                 'components.gyp:storage_monitor_test_support',
172
173                 # Dependencies of url_matcher.
174                 'components.gyp:url_matcher',
175
176                 # Dependencies of visitedlink
177                 'components.gyp:visitedlink_browser',
178                 'components.gyp:visitedlink_renderer',
179                 '../content/content_resources.gyp:content_resources',
180
181                 # Dependencies of web_modal
182                 'components.gyp:web_modal',
183                 'components.gyp:web_modal_test_support',
184               ],
185             }, { # 'OS == "ios"'
186               'sources/': [
187                 ['exclude', '\\.cc$'],
188                 ['exclude', '\\.mm$'],
189                 ['include', '^test/run_all_unittests\\.cc$'],
190                 # TODO(ios): Include files here as they are made to work, see
191                 # http://crbug.com/303011.
192                 # TODO(asvitkine): Bring up variations/ unittests on iOS.
193                 # TODO(blundell): Bring up json_schema/ unittests on iOS.
194                 ['include', '^auto_login_parser/'],
195                 ['include', '^autofill/'],
196                 ['include', '^dom_distiller/'],
197                 ['include', '^language_usage_metrics/'],
198                 ['include', '^password_manager/'],
199                 ['include', '^precache/core/'],
200                 ['include', '^signin/'],
201                 ['include', '^sync_driver/'],
202                 ['include', '^translate/'],
203                 # TODO(blundell): Provide the iOS login DB implementation and
204                 # then re-enable this test. http://crbug.com/341429
205                 ['exclude', '^password_manager/core/browser/login_database_unittest.cc'],
206               ],
207               'conditions': [
208                 ['configuration_policy==1', {
209                   'sources/': [
210                     ['include', '^policy/'],
211                   ],
212                 }],
213               ],
214             }],
215             ['disable_nacl==0', {
216               'sources': [
217                 'nacl/browser/nacl_file_host_unittest.cc',
218                 'nacl/browser/nacl_process_host_unittest.cc',
219                 'nacl/browser/nacl_validation_cache_unittest.cc',
220                 'nacl/browser/pnacl_host_unittest.cc',
221                 'nacl/browser/pnacl_translation_cache_unittest.cc',
222                 'nacl/browser/test_nacl_browser_delegate.cc',
223               ],
224               'dependencies': [
225                 'nacl.gyp:nacl_browser',
226                 'nacl.gyp:nacl_common',
227               ],
228             }],
229             ['OS == "mac"', {
230               'link_settings': {
231                 'libraries': [
232                   '$(SDKROOT)/System/Library/Frameworks/AddressBook.framework',
233                   '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
234                   '$(SDKROOT)/System/Library/Frameworks/ImageCaptureCore.framework',
235                 ],
236               },
237               'sources!': [
238                 'password_manager/core/browser/password_store_default_unittest.cc',
239               ],
240             }],
241             ['OS == "android"', {
242               'sources!': [
243                 'storage_monitor/media_storage_util_unittest.cc',
244                 'storage_monitor/storage_info_unittest.cc',
245                 'storage_monitor/storage_monitor_unittest.cc',
246                 'web_modal/web_contents_modal_dialog_manager_unittest.cc',
247               ],
248               'dependencies!': [
249                 'components.gyp:storage_monitor',
250                 'components.gyp:storage_monitor_test_support',
251                 'components.gyp:web_modal',
252                 'components.gyp:web_modal_test_support',
253               ],
254             }],
255             ['OS == "android" and gtest_target_type == "shared_library"', {
256               'dependencies': [
257                 '../testing/android/native_test.gyp:native_test_native_code',
258               ]
259             }],
260             ['chromeos==1', {
261               'sources!': [
262                 'storage_monitor/storage_monitor_linux_unittest.cc',
263               ],
264               'dependencies': [
265                 '../chromeos/chromeos.gyp:chromeos_test_support',
266               ],
267             }],
268             ['OS=="linux"', {
269               'dependencies': [
270                 '../dbus/dbus.gyp:dbus',
271                 '../device/media_transfer_protocol/media_transfer_protocol.gyp:device_media_transfer_protocol',
272               ],
273             }],
274             ['OS=="win" and win_use_allocator_shim==1', {
275               'dependencies': [
276                 '../base/allocator/allocator.gyp:allocator',
277               ],
278             }],
279             ['OS=="linux" and component=="shared_library" and linux_use_tcmalloc==1', {
280             'dependencies': [
281                 '<(DEPTH)/base/allocator/allocator.gyp:allocator',
282             ],
283             'link_settings': {
284                 'ldflags': ['-rdynamic'],
285             },
286             }],
287             ['configuration_policy==1', {
288               'dependencies': [
289                 'components.gyp:policy_component',
290                 'components.gyp:policy_component_test_support',
291                 'components.gyp:policy_test_support',
292               ],
293               'sources': [
294                 'policy/core/browser/autofill_policy_handler_unittest.cc',
295                 'policy/core/browser/browser_policy_connector_unittest.cc',
296                 'policy/core/browser/configuration_policy_handler_unittest.cc',
297                 'policy/core/common/async_policy_provider_unittest.cc',
298                 'policy/core/common/cloud/cloud_policy_client_unittest.cc',
299                 'policy/core/common/cloud/cloud_policy_core_unittest.cc',
300                 'policy/core/common/cloud/cloud_policy_manager_unittest.cc',
301                 'policy/core/common/cloud/cloud_policy_refresh_scheduler_unittest.cc',
302                 'policy/core/common/cloud/cloud_policy_service_unittest.cc',
303                 'policy/core/common/cloud/cloud_policy_validator_unittest.cc',
304                 'policy/core/common/cloud/component_cloud_policy_service_unittest.cc',
305                 'policy/core/common/cloud/component_cloud_policy_store_unittest.cc',
306                 'policy/core/common/cloud/component_cloud_policy_updater_unittest.cc',
307                 'policy/core/common/cloud/device_management_service_unittest.cc',
308                 'policy/core/common/cloud/external_policy_data_fetcher_unittest.cc',
309                 'policy/core/common/cloud/external_policy_data_updater_unittest.cc',
310                 'policy/core/common/cloud/policy_header_io_helper_unittest.cc',
311                 'policy/core/common/cloud/policy_header_service_unittest.cc',
312                 'policy/core/common/cloud/rate_limiter_unittest.cc',
313                 'policy/core/common/cloud/resource_cache_unittest.cc',
314                 'policy/core/common/cloud/user_cloud_policy_manager_unittest.cc',
315                 'policy/core/common/cloud/user_cloud_policy_store_unittest.cc',
316                 'policy/core/common/cloud/user_info_fetcher_unittest.cc',
317                 'policy/core/common/config_dir_policy_loader_unittest.cc',
318                 'policy/core/common/forwarding_policy_provider_unittest.cc',
319                 'policy/core/common/generate_policy_source_unittest.cc',
320                 'policy/core/common/policy_bundle_unittest.cc',
321                 'policy/core/common/policy_loader_mac_unittest.cc',
322                 'policy/core/common/policy_loader_win_unittest.cc',
323                 'policy/core/common/policy_map_unittest.cc',
324                 'policy/core/common/policy_provider_android_unittest.cc',
325                 'policy/core/common/policy_service_impl_unittest.cc',
326                 'policy/core/common/policy_statistics_collector_unittest.cc',
327                 'policy/core/common/preg_parser_win_unittest.cc',
328                 'policy/core/common/registry_dict_win_unittest.cc',
329                 'policy/core/common/schema_map_unittest.cc',
330                 'policy/core/common/schema_registry_unittest.cc',
331                 'policy/core/common/schema_unittest.cc',
332               ],
333               'conditions': [
334                 ['OS=="android" or OS=="ios"', {
335                   # Note: 'sources!' is processed before any 'sources/', so the
336                   # ['include', '^policy/'] on iOS above will include all of the
337                   # policy source files again. Using 'source/' here too will get
338                   # these files excluded as expected.
339                   'sources/': [
340                     ['exclude', '^policy/core/common/async_policy_provider_unittest\\.cc'],
341                     ['exclude', '^policy/core/common/cloud/component_cloud_policy_service_unittest\\.cc'],
342                     ['exclude', '^policy/core/common/cloud/component_cloud_policy_store_unittest\\.cc'],
343                     ['exclude', '^policy/core/common/cloud/component_cloud_policy_updater_unittest\\.cc'],
344                     ['exclude', '^policy/core/common/cloud/external_policy_data_fetcher_unittest\\.cc'],
345                     ['exclude', '^policy/core/common/cloud/external_policy_data_updater_unittest\\.cc'],
346                     ['exclude', '^policy/core/common/cloud/resource_cache_unittest\\.cc'],
347                     ['exclude', '^policy/core/common/config_dir_policy_loader_unittest\\.cc'],
348                   ],
349                 }],
350                 ['chromeos==1', {
351                   'sources': [
352                     'policy/core/common/proxy_policy_provider_unittest.cc',
353                   ],
354                   'sources!': [
355                     'policy/core/common/cloud/user_cloud_policy_manager_unittest.cc',
356                     'policy/core/common/cloud/user_cloud_policy_store_unittest.cc',
357                   ],
358                 }],
359               ],
360             }],
361           ],
362           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
363           'msvs_disabled_warnings': [4267, ],
364         },
365       ],
366     }],
367     ['OS != "ios" and android_webview_build == 0', {
368       'targets': [
369         {
370           'target_name': 'components_perftests',
371           'type': '<(gtest_target_type)',
372           'dependencies': [
373             '../base/base.gyp:base',
374             '../base/base.gyp:test_support_perf',
375             '../content/content_shell_and_tests.gyp:test_support_content',
376             '../testing/gtest.gyp:gtest',
377             'components.gyp:visitedlink_browser',
378           ],
379          'include_dirs': [
380            '..',
381          ],
382          'sources': [
383            'visitedlink/test/visitedlink_perftest.cc',
384          ],
385          'conditions': [
386            ['OS == "android" and gtest_target_type == "shared_library"', {
387              'dependencies': [
388                '../testing/android/native_test.gyp:native_test_native_code',
389              ],
390            }],
391          ],
392          # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
393          'msvs_disabled_warnings': [ 4267, ],
394         },
395       ],
396       'conditions': [
397         ['OS == "android" and gtest_target_type == "shared_library"', {
398           'targets': [
399             {
400               'target_name': 'components_unittests_apk',
401               'type': 'none',
402               'dependencies': [
403                 'components_unittests',
404               ],
405               'variables': {
406                 'test_suite_name': 'components_unittests',
407                 'input_shlib_path': '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)components_unittests<(SHARED_LIB_SUFFIX)',
408               },
409               'includes': [ '../build/apk_test.gypi' ],
410             },
411           ],
412         }],
413       ],
414     }],
415     ['OS!="ios"', {
416       'targets': [
417         {
418           'target_name': 'components_browsertests',
419           'type': '<(gtest_target_type)',
420           'defines!': ['CONTENT_IMPLEMENTATION'],
421           'dependencies': [
422             '../content/content_shell_and_tests.gyp:content_browser_test_support',
423             '../content/content_shell_and_tests.gyp:test_support_content',
424             '../skia/skia.gyp:skia',
425             '../testing/gtest.gyp:gtest',
426             'components.gyp:dom_distiller_content',
427             'components.gyp:dom_distiller_core',
428           ],
429           'include_dirs': [
430             '..',
431           ],
432           'defines': [
433             'HAS_OUT_OF_PROC_TEST_RUNNER',
434           ],
435           'sources': [
436             '../content/test/content_test_launcher.cc',
437             'dom_distiller/content/distiller_page_web_contents_browsertest.cc',
438           ],
439           'conditions': [
440             ['OS=="win"', {
441               'resource_include_dirs': [
442                 '<(SHARED_INTERMEDIATE_DIR)/webkit',
443               ],
444               'sources': [
445                 '../content/shell/app/resource.h',
446                 '../content/shell/app/shell.rc',
447                 # TODO:  It would be nice to have these pulled in
448                 # automatically from direct_dependent_settings in
449                 # their various targets (net.gyp:net_resources, etc.),
450                 # but that causes errors in other targets when
451                 # resulting .res files get referenced multiple times.
452                 '<(SHARED_INTERMEDIATE_DIR)/net/net_resources.rc',
453                 '<(SHARED_INTERMEDIATE_DIR)/webkit/blink_resources.rc',
454                 '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_strings_en-US.rc',
455               ],
456               'dependencies': [
457                 '<(DEPTH)/net/net.gyp:net_resources',
458                 '<(DEPTH)/third_party/iaccessible2/iaccessible2.gyp:iaccessible2',
459                 '<(DEPTH)/third_party/isimpledom/isimpledom.gyp:isimpledom',
460                 '<(DEPTH)/webkit/webkit_resources.gyp:webkit_strings',
461                 '<(DEPTH)/webkit/webkit_resources.gyp:webkit_resources',
462               ],
463               'configurations': {
464                 'Debug_Base': {
465                   'msvs_settings': {
466                     'VCLinkerTool': {
467                       'LinkIncremental': '<(msvs_large_module_debug_link_mode)',
468                     },
469                   },
470                 },
471               },
472               # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
473               'msvs_disabled_warnings': [ 4267, ],
474             }],
475             ['OS=="win" and win_use_allocator_shim==1', {
476               'dependencies': [
477                 '../base/allocator/allocator.gyp:allocator',
478               ],
479             }],
480           ],
481         },
482       ],
483     }],
484   ],
485 }