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