Use whether a query is from the app list to determine the RLZ parameter.
[chromium-blink-merge.git] / ui / ui_unittests.gyp
blob7b7d3e439daaca09df9eac9865807bdd07b95e1a
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   'variables': {
7     'chromium_code': 1,
8   },
9   'targets': [
10     {
11       'target_name': 'ui_test_support',
12       'dependencies': [
13         '../base/base.gyp:base',
14         '../skia/skia.gyp:skia',
15         '../testing/gtest.gyp:gtest',
16         'gfx/gfx.gyp:gfx',
17         'gfx/gfx.gyp:gfx_geometry',
18       ],
19       'sources': [
20         'base/test/ui_controls.h',
21         'base/test/ui_controls_aura.cc',
22         'base/test/ui_controls_gtk.cc',
23         'base/test/ui_controls_internal_win.cc',
24         'base/test/ui_controls_internal_win.h',
25         'base/test/ui_controls_mac.mm',
26         'base/test/ui_controls_win.cc',
27       ],
28       'include_dirs': [
29         '../',
30       ],
31       'conditions': [
32         ['OS!="ios"', {
33           'type': 'static_library',
34           'includes': [ 'base/ime/ime_test_support.gypi' ],
35         }, {  # OS=="ios"
36           # None of the sources in this target are built on iOS, resulting in
37           # link errors when building targets that depend on this target
38           # because the static library isn't found. If this target is changed
39           # to have sources that are built on iOS, the target should be changed
40           # to be of type static_library on all platforms.
41           'type': 'none',
42           # The cocoa files don't apply to iOS.
43           'sources/': [['exclude', 'cocoa']],
44         }],
45         ['chromeos==1', {
46           'dependencies': [
47             '../chromeos/chromeos.gyp:chromeos_test_support_without_gmock',
48             '../skia/skia.gyp:skia',
49           ],
50         }],
51         ['use_aura==1', {
52           'sources!': [
53             'base/test/ui_controls_mac.mm',
54             'base/test/ui_controls_win.cc',
55           ],
56         }],
57       ],
58     },
59     {
60       'target_name': 'ui_unittests',
61       'type': '<(gtest_target_type)',
62       'dependencies': [
63         '../base/base.gyp:base',
64         '../base/base.gyp:test_support_base',
65         '../skia/skia.gyp:skia',
66         '../testing/gmock.gyp:gmock',
67         '../testing/gtest.gyp:gtest',
68         '../third_party/icu/icu.gyp:icui18n',
69         '../third_party/icu/icu.gyp:icuuc',
70         '../third_party/libpng/libpng.gyp:libpng',
71         '../url/url.gyp:url_lib',
72         'base/strings/ui_strings.gyp:ui_strings',
73         'base/ui_base.gyp:ui_base',
74         'events/events.gyp:events_base',
75         'gfx/gfx.gyp:gfx_test_support',
76         'resources/ui_resources.gyp:ui_resources',
77         'resources/ui_resources.gyp:ui_test_pak',
78         'ui_test_support',
79       ],
80       # iOS uses a small subset of ui. common_sources are the only files that
81       # are built on iOS.
82       'common_sources' : [
83         'base/layout_unittest.cc',
84         'base/l10n/l10n_util_mac_unittest.mm',
85         'base/l10n/l10n_util_unittest.cc',
86         'base/l10n/l10n_util_win_unittest.cc',
87         'base/l10n/time_format_unittest.cc',
88         'base/models/tree_node_iterator_unittest.cc',
89         'base/resource/data_pack_literal.cc',
90         'base/resource/data_pack_unittest.cc',
91         'base/resource/resource_bundle_unittest.cc',
92         'base/test/run_all_unittests.cc',
93         'gfx/animation/animation_container_unittest.cc',
94         'gfx/animation/animation_unittest.cc',
95         'gfx/animation/multi_animation_unittest.cc',
96         'gfx/animation/slide_animation_unittest.cc',
97         'gfx/codec/png_codec_unittest.cc',
98         'gfx/color_utils_unittest.cc',
99         'gfx/display_unittest.cc',
100         'gfx/font_unittest.cc',
101         'gfx/image/image_family_unittest.cc',
102         'gfx/image/image_skia_unittest.cc',
103         'gfx/image/image_unittest.cc',
104         'gfx/image/image_unittest_util.cc',
105         'gfx/image/image_unittest_util.h',
106         'gfx/image/image_unittest_util_ios.mm',
107         'gfx/image/image_unittest_util_mac.mm',
108         'gfx/screen_unittest.cc',
109         'gfx/shadow_value_unittest.cc',
110         'gfx/skbitmap_operations_unittest.cc',
111         'gfx/skrect_conversion_unittest.cc',
112         'gfx/text_elider_unittest.cc',
113         'gfx/text_utils_unittest.cc',
114       ],
115       'all_sources': [
116         '<@(_common_sources)',
117         'base/accelerators/accelerator_manager_unittest.cc',
118         'base/accelerators/menu_label_accelerator_util_linux_unittest.cc',
119         'base/clipboard/clipboard_unittest.cc',
120         'base/clipboard/custom_data_helper_unittest.cc',
121         'base/cocoa/base_view_unittest.mm',
122         'base/cocoa/cocoa_base_utils_unittest.mm',
123         'base/cocoa/controls/blue_label_button_unittest.mm',
124         'base/cocoa/controls/hover_image_menu_button_unittest.mm',
125         'base/cocoa/controls/hyperlink_button_cell_unittest.mm',
126         'base/cocoa/focus_tracker_unittest.mm',
127         'base/cocoa/fullscreen_window_manager_unittest.mm',
128         'base/cocoa/hover_image_button_unittest.mm',
129         'base/cocoa/menu_controller_unittest.mm',
130         'base/cocoa/nsgraphics_context_additions_unittest.mm',
131         'base/cocoa/tracking_area_unittest.mm',
132         'base/dragdrop/os_exchange_data_provider_aurax11_unittest.cc',
133         'base/gtk/gtk_expanded_container_unittest.cc',
134         'base/models/list_model_unittest.cc',
135         'base/models/list_selection_model_unittest.cc',
136         'base/models/tree_node_model_unittest.cc',
137         'base/test/data/resource.h',
138         'base/text/bytes_formatting_unittest.cc',
139         'base/view_prop_unittest.cc',
140         'base/webui/web_ui_util_unittest.cc',
141         'gfx/animation/tween_unittest.cc',
142         'gfx/blit_unittest.cc',
143         'gfx/break_list_unittest.cc',
144         'gfx/canvas_unittest.cc',
145         'gfx/canvas_unittest_mac.mm',
146         'gfx/codec/jpeg_codec_unittest.cc',
147         'gfx/color_analysis_unittest.cc',
148         'gfx/font_list_unittest.cc',
149         'gfx/image/image_mac_unittest.mm',
150         'gfx/image/image_util_unittest.cc',
151         'gfx/ozone/dri/hardware_display_controller_unittest.cc',
152         'gfx/ozone/dri/dri_surface_factory_unittest.cc',
153         'gfx/ozone/dri/dri_surface_unittest.cc',
154         'gfx/platform_font_mac_unittest.mm',
155         'gfx/render_text_unittest.cc',
156         'gfx/sequential_id_generator_unittest.cc',
157         'gfx/transform_util_unittest.cc',
158         'gfx/utf16_indexing_unittest.cc',
159       ],
160       'includes': [
161         'display/display_unittests.gypi',
162       ],
163       'include_dirs': [
164         '../',
165       ],
166       'conditions': [
167         ['OS!="ios"', {
168           'sources' : ['<@(_all_sources)'],
169           'includes': [
170             'base/ime/ime_unittests.gypi',
171           ],
172         }, {  # OS=="ios"
173           'sources' : [
174             '<@(_common_sources)',
175           ],
176           # The ResourceBundle unittest expects a locale.pak file to exist in
177           # the bundle for English-US. Copy it in from where it was generated
178           # by ui_resources.gyp:ui_test_pak.
179           'mac_bundle_resources': [
180             '<(PRODUCT_DIR)/ui/en.lproj/locale.pak',
181           ],
182         }],
183         ['OS == "win"', {
184           'sources': [
185             'base/dragdrop/os_exchange_data_win_unittest.cc',
186             'base/win/hwnd_subclass_unittest.cc',
187             'gfx/font_fallback_win_unittest.cc',
188             'gfx/icon_util_unittest.cc',
189             'gfx/icon_util_unittests.rc',
190             'gfx/platform_font_win_unittest.cc',
191           ],
192           'include_dirs': [
193             '../..',
194             '../third_party/wtl/include',
195           ],
196           'msvs_settings': {
197             'VCLinkerTool': {
198               'DelayLoadDLLs': [
199                 'd2d1.dll',
200                 'd3d10_1.dll',
201               ],
202               'AdditionalDependencies': [
203                 'd2d1.lib',
204                 'd3d10_1.lib',
205               ],
206             },
207           },
208           'link_settings': {
209             'libraries': [
210               '-limm32.lib',
211               '-loleacc.lib',
212             ],
213           },
214           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
215           'msvs_disabled_warnings': [ 4267, ],
216         }],
217         ['OS != "mac" and OS != "ios"', {
218           'sources': [
219             'gfx/transform_unittest.cc',
220             'gfx/interpolated_transform_unittest.cc',
221           ],
222         }],
223         ['OS == "android"', {
224           'sources': [
225             'gfx/android/scroller_unittest.cc',
226           ],
227         }],
228         ['OS == "android" and gtest_target_type == "shared_library"', {
229           'dependencies': [
230             '../testing/android/native_test.gyp:native_test_native_code',
231           ],
232         }],
233         ['use_pango == 1', {
234           'dependencies': [
235             '../build/linux/system.gyp:fontconfig',
236             '../build/linux/system.gyp:pangocairo',
237           ],
238           'sources': [
239             'gfx/platform_font_pango_unittest.cc',
240           ],
241           'conditions': [
242             # TODO(dmikurube): Kill linux_use_tcmalloc. http://crbug.com/345554
243             ['(use_allocator!="none" and use_allocator!="see_use_tcmalloc") or (use_allocator=="see_use_tcmalloc" and linux_use_tcmalloc==1)', {
244                'dependencies': [
245                  '../base/allocator/allocator.gyp:allocator',
246                ],
247             }],
248           ],
249         }],
250         ['use_x11==1', {
251           'dependencies': [
252             '../tools/xdisplaycheck/xdisplaycheck.gyp:xdisplaycheck',
253           ],
254         }],
255         ['toolkit_uses_gtk == 1', {
256           'sources': [
257             'base/dragdrop/gtk_dnd_util_unittest.cc',
258           ],
259           'dependencies': [
260             '../build/linux/system.gyp:gtk',
261           ],
262         }],
263         ['OS=="android" or OS=="ios"', {
264           'sources!': [
265             'gfx/render_text_unittest.cc',
266           ],
267         }],
268         ['OS!="win" or use_aura==0', {
269           'sources!': [
270             'base/view_prop_unittest.cc',
271           ],
272         }],
273         ['use_x11==1 and use_aura==1',  {
274           'sources': [
275             'base/cursor/cursor_loader_x11_unittest.cc',
276           ],
277         }],
278         ['OS=="mac"',  {
279           'dependencies': [
280             'events/events.gyp:events_test_support',
281             'gfx/gfx.gyp:gfx_test_support',
282             'ui_unittests_bundle',
283           ],
284         }],
285         ['use_aura==1 or toolkit_views==1',  {
286           'sources': [
287             'base/dragdrop/os_exchange_data_unittest.cc',
288           ],
289           'dependencies': [
290             'events/events.gyp:events',
291             'events/events.gyp:events_base',
292             'events/events.gyp:events_test_support',
293           ],
294         }],
295         ['use_aura==1', {
296           'sources!': [
297             'base/dragdrop/os_exchange_data_win_unittest.cc',
298             'gfx/screen_unittest.cc',
299           ],
300         }],
301         ['use_ozone==1', {
302           'dependencies': [
303           '<(DEPTH)/build/linux/system.gyp:dridrm',
304           ],
305         }],
306         ['use_ozone==1 and use_pango==0', {
307           'sources!': [
308             'gfx/text_elider_unittest.cc',
309             'gfx/font_unittest.cc',
310             'gfx/font_list_unittest.cc',
311             'gfx/render_text_unittest.cc',
312             'gfx/canvas_unittest.cc',
313           ],
314         }],
315         ['chromeos==1', {
316           'sources!': [
317             'base/dragdrop/os_exchange_data_provider_aurax11_unittest.cc',
318           ],
319         }],
320       ],
321       'target_conditions': [
322         ['OS == "ios"', {
323           'sources/': [
324             # Pull in specific Mac files for iOS (which have been filtered out
325             # by file name rules).
326             ['include', '^base/l10n/l10n_util_mac_unittest\\.mm$'],
327           ],
328         }],
329       ],
330     },
331   ],
332   'conditions': [
333     # Mac target to build a test Framework bundle to mock out resource loading.
334     ['OS == "mac"', {
335       'targets': [
336         {
337           'target_name': 'ui_unittests_bundle',
338           'type': 'shared_library',
339           'dependencies': [
340             'resources/ui_resources.gyp:ui_test_pak',
341           ],
342           'includes': [ 'ui_unittests_bundle.gypi' ],
343         },
344       ],
345     }],
346     # Special target to wrap a gtest_target_type==shared_library
347     # ui_unittests into an android apk for execution.
348     # See base.gyp for TODO(jrg)s about this strategy.
349     ['OS == "android" and gtest_target_type == "shared_library"', {
350       'targets': [
351         {
352           'target_name': 'ui_unittests_apk',
353           'type': 'none',
354           'dependencies': [
355             'ui_unittests',
356           ],
357           'variables': {
358             'test_suite_name': 'ui_unittests',
359             'input_shlib_path': '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)ui_unittests<(SHARED_LIB_SUFFIX)',
360           },
361           'includes': [ '../build/apk_test.gypi' ],
362         },
363       ],
364     }],
365   ],