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