- add sources.
[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/common/form_data_unittest.cc',
22             'autofill/core/common/form_field_data_unittest.cc',
23             'autofill/core/common/password_form_fill_data_unittest.cc',
24             'browser_context_keyed_service/browser_context_dependency_manager_unittest.cc',
25             'browser_context_keyed_service/dependency_graph_unittest.cc',
26             'dom_distiller/core/distiller_url_fetcher_unittest.cc',
27             'dom_distiller/core/dom_distiller_database_unittest.cc',
28             'dom_distiller/core/dom_distiller_model_unittest.cc',
29             'dom_distiller/core/dom_distiller_store_unittest.cc',
30             'dom_distiller/core/article_entry_unittest.cc',
31             'json_schema/json_schema_validator_unittest.cc',
32             'json_schema/json_schema_validator_unittest_base.cc',
33             'json_schema/json_schema_validator_unittest_base.h',
34             'navigation_interception/intercept_navigation_resource_throttle_unittest.cc',
35             'precache/core/precache_fetcher_unittest.cc',
36             'sessions/serialized_navigation_entry_unittest.cc',
37             'test/run_all_unittests.cc',
38             'translate/common/translate_metrics_unittest.cc',
39             'translate/common/translate_util_unittest.cc',
40             'translate/language_detection/language_detection_util_unittest.cc',
41             # TODO(asvitkine): These should be tested on iOS too.
42             'variations/entropy_provider_unittest.cc',
43             'variations/metrics_util_unittest.cc',
44             'variations/variations_associated_data_unittest.cc',
45             'variations/variations_seed_processor_unittest.cc',
46             'visitedlink/test/visitedlink_unittest.cc',
47             'webdata/encryptor/encryptor_password_mac_unittest.cc',
48             'webdata/encryptor/encryptor_unittest.cc',
49             'webdata/encryptor/ie7_password_unittest_win.cc',
50             'web_modal/web_contents_modal_dialog_manager_unittest.cc',
51           ],
52           'include_dirs': [
53             '..',
54           ],
55           'dependencies': [
56             '../base/base.gyp:test_support_base',
57             '../sync/sync.gyp:sync',
58             '../testing/gmock.gyp:gmock',
59             '../testing/gtest.gyp:gtest',
60
61             # Dependencies of autofill
62             'components.gyp:autofill_core_browser',
63             'components.gyp:autofill_core_common',
64
65             # Dependencies of auto_login_parser
66             'components.gyp:auto_login_parser',
67
68             # Dependencies of browser_context_keyed_service
69             'components.gyp:browser_context_keyed_service',
70
71             # Dependencies of dom_distiller
72             'components.gyp:distilled_page_proto',
73             'components.gyp:dom_distiller_core',
74
75             # Dependencies of encryptor
76             'components.gyp:encryptor',
77
78             # Dependencies of json_schema
79             'components.gyp:json_schema',
80
81             # Dependencies of intercept_navigation_resource_throttle_unittest.cc
82             '../content/content_shell_and_tests.gyp:test_support_content',
83             '../skia/skia.gyp:skia',
84             'components.gyp:navigation_interception',
85
86             # Dependencies of policy
87             'components.gyp:policy_component',
88
89             # Dependencies of precache
90             'components.gyp:precache_core',
91             'components.gyp:precache_core_proto',
92
93             # Dependencies of sessions
94             '../third_party/protobuf/protobuf.gyp:protobuf_lite',
95             'components.gyp:sessions',
96             'components.gyp:sessions_test_support',
97
98             # Dependencies of translate.
99             'components.gyp:translate_common',
100             'components.gyp:translate_language_detection',
101
102             # Dependencies of variations
103             'components.gyp:variations',
104
105             # Dependencies of visitedlink
106             'components.gyp:visitedlink_browser',
107             'components.gyp:visitedlink_renderer',
108             '../content/content_resources.gyp:content_resources',
109
110             'components.gyp:web_modal',
111             'components.gyp:web_modal_test_support',
112           ],
113           'conditions': [
114             ['OS == "ios"', {
115               'sources/': [
116                 ['exclude', '\\.cc$'],
117                 ['include', '^test/run_all_unittests\\.cc$'],
118                 # TODO(ios): Include files here as they are made to work, see
119                 # http://crbug.com/303011.
120                 # TODO(asvitkine): Bring up varations/ unittests on iOS.
121                 ['include', '^dom_distiller'],
122                 ['include', '^translate'],
123               ],
124               'dependencies!': [
125                 'autofill_core_common',
126                 'navigation_interception',
127                 'visitedlink_renderer',
128               ],
129             }],
130             ['disable_nacl==0', {
131               'sources': [
132                 'nacl/browser/nacl_validation_cache_unittest.cc',
133               ],
134               'dependencies': [
135                 'nacl.gyp:nacl_browser',
136               ],
137             }],
138             ['OS == "android"', {
139               'sources!': [
140                 'web_modal/web_contents_modal_dialog_manager_unittest.cc',
141               ],
142               'dependencies!': [
143                 'components.gyp:web_modal',
144                 'components.gyp:web_modal_test_support',
145               ],
146             }],
147             ['OS == "android" and gtest_target_type == "shared_library"', {
148               'dependencies': [
149                 '../testing/android/native_test.gyp:native_test_native_code',
150               ]
151             }],
152             ['OS=="win" and win_use_allocator_shim==1', {
153               'dependencies': [
154                 '../base/allocator/allocator.gyp:allocator',
155               ],
156             }],
157             ['OS=="linux" and component=="shared_library" and linux_use_tcmalloc==1', {
158             'dependencies': [
159                 '<(DEPTH)/base/allocator/allocator.gyp:allocator',
160             ],
161             'link_settings': {
162                 'ldflags': ['-rdynamic'],
163             },
164             }],
165             ['configuration_policy==1', {
166               'sources': [
167                 'policy/core/common/schema_unittest.cc',
168               ],
169             }],
170           ],
171           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
172           'msvs_disabled_warnings': [4267, ],
173         },
174       ],
175     }],
176     ['OS != "ios" and android_webview_build == 0', {
177       'targets': [
178         {
179           'target_name': 'components_perftests',
180           'type': '<(gtest_target_type)',
181           'dependencies': [
182             '../base/base.gyp:base',
183             '../base/base.gyp:test_support_perf',
184             '../content/content_shell_and_tests.gyp:test_support_content',
185             '../testing/gtest.gyp:gtest',
186             '../ui/compositor/compositor.gyp:compositor',
187             'components.gyp:visitedlink_browser',
188           ],
189          'include_dirs': [
190            '..',
191          ],
192          'sources': [
193            'visitedlink/test/visitedlink_perftest.cc',
194          ],
195          'conditions': [
196            ['OS == "android" and gtest_target_type == "shared_library"', {
197              'dependencies': [
198                '../testing/android/native_test.gyp:native_test_native_code',
199              ],
200            }],
201          ],
202          # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
203          'msvs_disabled_warnings': [ 4267, ],
204         },
205       ],
206       'conditions': [
207         ['OS == "android" and gtest_target_type == "shared_library"', {
208           'targets': [
209             {
210               'target_name': 'components_unittests_apk',
211               'type': 'none',
212               'dependencies': [
213                 'components_unittests',
214               ],
215               'variables': {
216                 'test_suite_name': 'components_unittests',
217                 'input_shlib_path': '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)components_unittests<(SHARED_LIB_SUFFIX)',
218               },
219               'includes': [ '../build/apk_test.gypi' ],
220             },
221           ],
222         }],
223       ],
224     }],
225   ],
226 }