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