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