Upstream version 7.36.149.0
[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_unittests',
12       'type': '<(gtest_target_type)',
13       'dependencies': [
14         '../base/base.gyp:base',
15         '../base/base.gyp:test_support_base',
16         '../skia/skia.gyp:skia',
17         '../testing/gmock.gyp:gmock',
18         '../testing/gtest.gyp:gtest',
19         '../third_party/icu/icu.gyp:icui18n',
20         '../third_party/icu/icu.gyp:icuuc',
21         '../url/url.gyp:url_lib',
22         'base/strings/ui_strings.gyp:ui_strings',
23         'base/ui_base.gyp:ui_base',
24         'base/ui_base.gyp:ui_base_test_support',
25         'events/events.gyp:events_base',
26         'gfx/gfx.gyp:gfx_test_support',
27         'resources/ui_resources.gyp:ui_resources',
28         'resources/ui_resources.gyp:ui_test_pak',
29       ],
30       # iOS uses a small subset of ui. common_sources are the only files that
31       # are built on iOS.
32       'common_sources' : [
33         'base/layout_unittest.cc',
34         'base/l10n/l10n_util_mac_unittest.mm',
35         'base/l10n/l10n_util_unittest.cc',
36         'base/l10n/l10n_util_win_unittest.cc',
37         'base/l10n/time_format_unittest.cc',
38         'base/models/tree_node_iterator_unittest.cc',
39         'base/resource/data_pack_literal.cc',
40         'base/resource/data_pack_unittest.cc',
41         'base/resource/resource_bundle_unittest.cc',
42         'base/test/run_all_unittests.cc',
43         'gfx/font_unittest.cc',
44         'gfx/image/image_skia_unittest.cc',
45         'gfx/screen_unittest.cc',
46         'gfx/text_elider_unittest.cc',
47         'gfx/text_utils_unittest.cc',
48       ],
49       'all_sources': [
50         '<@(_common_sources)',
51         'base/accelerators/accelerator_manager_unittest.cc',
52         'base/accelerators/menu_label_accelerator_util_linux_unittest.cc',
53         'base/clipboard/clipboard_unittest.cc',
54         'base/clipboard/custom_data_helper_unittest.cc',
55         'base/cocoa/base_view_unittest.mm',
56         'base/cocoa/cocoa_base_utils_unittest.mm',
57         'base/cocoa/controls/blue_label_button_unittest.mm',
58         'base/cocoa/controls/hover_image_menu_button_unittest.mm',
59         'base/cocoa/controls/hyperlink_button_cell_unittest.mm',
60         'base/cocoa/focus_tracker_unittest.mm',
61         'base/cocoa/fullscreen_window_manager_unittest.mm',
62         'base/cocoa/hover_image_button_unittest.mm',
63         'base/cocoa/menu_controller_unittest.mm',
64         'base/cocoa/nsgraphics_context_additions_unittest.mm',
65         'base/cocoa/tracking_area_unittest.mm',
66         'base/dragdrop/os_exchange_data_provider_aurax11_unittest.cc',
67         'base/models/list_model_unittest.cc',
68         'base/models/list_selection_model_unittest.cc',
69         'base/models/tree_node_model_unittest.cc',
70         'base/test/data/resource.h',
71         'base/text/bytes_formatting_unittest.cc',
72         'base/view_prop_unittest.cc',
73         'base/webui/web_ui_util_unittest.cc',
74         'gfx/canvas_unittest.cc',
75         'gfx/canvas_unittest_mac.mm',
76         'gfx/font_list_unittest.cc',
77         'gfx/platform_font_mac_unittest.mm',
78         'gfx/render_text_unittest.cc',
79       ],
80       'includes': [
81         'display/display_unittests.gypi',
82         'ozone/ozone_unittests.gypi',
83       ],
84       'include_dirs': [
85         '../',
86       ],
87       'conditions': [
88         ['OS!="ios"', {
89           'sources' : ['<@(_all_sources)'],
90           'includes': [
91             'base/ime/ime_unittests.gypi',
92           ],
93         }, {  # OS=="ios"
94           'sources' : [
95             '<@(_common_sources)',
96           ],
97           # The ResourceBundle unittest expects a locale.pak file to exist in
98           # the bundle for English-US. Copy it in from where it was generated
99           # by ui_resources.gyp:ui_test_pak.
100           'mac_bundle_resources': [
101             '<(PRODUCT_DIR)/ui/en.lproj/locale.pak',
102           ],
103         }],
104         ['OS == "win"', {
105           'sources': [
106             'base/dragdrop/os_exchange_data_win_unittest.cc',
107             'base/win/hwnd_subclass_unittest.cc',
108             'gfx/font_fallback_win_unittest.cc',
109             'gfx/icon_util_unittest.cc',
110             'gfx/icon_util_unittests.rc',
111             'gfx/platform_font_win_unittest.cc',
112           ],
113           'include_dirs': [
114             '../..',
115             '../third_party/wtl/include',
116           ],
117           'msvs_settings': {
118             'VCLinkerTool': {
119               'DelayLoadDLLs': [
120                 'd2d1.dll',
121                 'd3d10_1.dll',
122               ],
123               'AdditionalDependencies': [
124                 'd2d1.lib',
125                 'd3d10_1.lib',
126               ],
127             },
128           },
129           'link_settings': {
130             'libraries': [
131               '-limm32.lib',
132               '-loleacc.lib',
133             ],
134           },
135           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
136           'msvs_disabled_warnings': [ 4267, ],
137         }],
138         ['OS == "android"', {
139           'sources': [
140             'gfx/android/scroller_unittest.cc',
141           ],
142         }],
143         ['OS == "android" and gtest_target_type == "shared_library"', {
144           'dependencies': [
145             '../testing/android/native_test.gyp:native_test_native_code',
146           ],
147         }],
148         ['use_pango == 1', {
149           'dependencies': [
150             '../build/linux/system.gyp:fontconfig',
151             '../build/linux/system.gyp:pangocairo',
152           ],
153           'sources': [
154             'gfx/platform_font_pango_unittest.cc',
155           ],
156           'conditions': [
157             ['use_allocator!="none"', {
158                'dependencies': [
159                  '../base/allocator/allocator.gyp:allocator',
160                ],
161             }],
162           ],
163         }],
164         ['use_x11==1', {
165           'dependencies': [
166             '../tools/xdisplaycheck/xdisplaycheck.gyp:xdisplaycheck',
167           ],
168         }],
169         ['OS=="android" or OS=="ios"', {
170           'sources!': [
171             'gfx/render_text_unittest.cc',
172           ],
173         }],
174         ['OS!="win" or use_aura==0', {
175           'sources!': [
176             'base/view_prop_unittest.cc',
177           ],
178         }],
179         ['use_x11==1 and use_aura==1',  {
180           'sources': [
181             'base/cursor/cursor_loader_x11_unittest.cc',
182           ],
183         }],
184         ['OS=="mac"',  {
185           'dependencies': [
186             'events/events.gyp:events_test_support',
187             'gfx/gfx.gyp:gfx_test_support',
188             'ui_unittests_bundle',
189           ],
190         }],
191         ['use_aura==1 or toolkit_views==1',  {
192           'sources': [
193             'base/dragdrop/os_exchange_data_unittest.cc',
194           ],
195           'dependencies': [
196             'events/events.gyp:events',
197             'events/events.gyp:events_base',
198             'events/events.gyp:events_test_support',
199           ],
200         }],
201         ['use_aura==1', {
202           'sources!': [
203             'base/dragdrop/os_exchange_data_win_unittest.cc',
204             'gfx/screen_unittest.cc',
205           ],
206         }],
207         ['use_ozone==1 and use_pango==0', {
208           'sources!': [
209             'gfx/text_elider_unittest.cc',
210             'gfx/font_unittest.cc',
211             'gfx/font_list_unittest.cc',
212             'gfx/render_text_unittest.cc',
213             'gfx/canvas_unittest.cc',
214           ],
215         }],
216         ['chromeos==1', {
217           'dependencies': [
218             '../chromeos/chromeos.gyp:chromeos',
219             'aura/aura.gyp:aura_test_support',
220             'chromeos/ui_chromeos.gyp:ui_chromeos',
221           ],
222           'sources': [
223             'chromeos/touch_exploration_controller_unittest.cc'
224           ],
225           'sources!': [
226             'base/dragdrop/os_exchange_data_provider_aurax11_unittest.cc',
227           ],
228         }],
229       ],
230       'target_conditions': [
231         ['OS == "ios"', {
232           'sources/': [
233             # Pull in specific Mac files for iOS (which have been filtered out
234             # by file name rules).
235             ['include', '^base/l10n/l10n_util_mac_unittest\\.mm$'],
236           ],
237         }],
238       ],
239     },
240   ],
241   'conditions': [
242     # Mac target to build a test Framework bundle to mock out resource loading.
243     ['OS == "mac"', {
244       'targets': [
245         {
246           'target_name': 'ui_unittests_bundle',
247           'type': 'shared_library',
248           'dependencies': [
249             'resources/ui_resources.gyp:ui_test_pak',
250           ],
251           'includes': [ 'ui_unittests_bundle.gypi' ],
252         },
253       ],
254     }],
255     # Special target to wrap a gtest_target_type==shared_library
256     # ui_unittests into an android apk for execution.
257     # See base.gyp for TODO(jrg)s about this strategy.
258     ['OS == "android" and gtest_target_type == "shared_library"', {
259       'targets': [
260         {
261           'target_name': 'ui_unittests_apk',
262           'type': 'none',
263           'dependencies': [
264             'ui_unittests',
265           ],
266           'variables': {
267             'test_suite_name': 'ui_unittests',
268           },
269           'includes': [ '../build/apk_test.gypi' ],
270         },
271       ],
272     }],
273   ],
274 }