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