Revert of Update V8 to version 3.27.17 (based on bleeding_edge revision r21586) ...
[chromium-blink-merge.git] / ui / ui_unittests.gyp
blob94e30891bce5ce2b52bc561f240495cce67742d9
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_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/ui_base.gyp:ui_base',
23         'base/ui_base.gyp:ui_base_test_support',
24         'events/events.gyp:events_base',
25         'gfx/gfx.gyp:gfx_test_support',
26         'resources/ui_resources.gyp:ui_resources',
27         'resources/ui_resources.gyp:ui_test_pak',
28         'strings/ui_strings.gyp:ui_strings',
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/screen_unittest.cc',
44       ],
45       'all_sources': [
46         '<@(_common_sources)',
47         'base/accelerators/accelerator_manager_unittest.cc',
48         'base/accelerators/menu_label_accelerator_util_linux_unittest.cc',
49         'base/clipboard/custom_data_helper_unittest.cc',
50         'base/cocoa/base_view_unittest.mm',
51         'base/cocoa/cocoa_base_utils_unittest.mm',
52         'base/cocoa/controls/blue_label_button_unittest.mm',
53         'base/cocoa/controls/hover_image_menu_button_unittest.mm',
54         'base/cocoa/controls/hyperlink_button_cell_unittest.mm',
55         'base/cocoa/focus_tracker_unittest.mm',
56         'base/cocoa/fullscreen_window_manager_unittest.mm',
57         'base/cocoa/hover_image_button_unittest.mm',
58         'base/cocoa/menu_controller_unittest.mm',
59         'base/cocoa/nsgraphics_context_additions_unittest.mm',
60         'base/cocoa/tracking_area_unittest.mm',
61         'base/dragdrop/os_exchange_data_provider_aurax11_unittest.cc',
62         'base/models/list_model_unittest.cc',
63         'base/models/list_selection_model_unittest.cc',
64         'base/models/tree_node_model_unittest.cc',
65         'base/test/data/resource.h',
66         'base/text/bytes_formatting_unittest.cc',
67         'base/view_prop_unittest.cc',
68         'base/webui/web_ui_util_unittest.cc',
69         'gfx/canvas_unittest.cc',
70         'gfx/canvas_unittest_mac.mm',
71         'gfx/platform_font_mac_unittest.mm',
72         'gfx/render_text_unittest.cc',
73       ],
74       'includes': [
75         'display/display_unittests.gypi',
76       ],
77       'include_dirs': [
78         '../',
79       ],
80       'conditions': [
81         ['OS!="ios"', {
82           'sources' : ['<@(_all_sources)'],
83           'includes': [
84             'base/ime/ime_unittests.gypi',
85           ],
86         }, {  # OS=="ios"
87           'sources' : [
88             '<@(_common_sources)',
89           ],
90           # The ResourceBundle unittest expects a locale.pak file to exist in
91           # the bundle for English-US. Copy it in from where it was generated
92           # by ui_resources.gyp:ui_test_pak.
93           'mac_bundle_resources': [
94             '<(PRODUCT_DIR)/ui/en.lproj/locale.pak',
95           ],
96           'actions': [
97             {
98               'action_name': 'copy_test_data',
99               'variables': {
100                 'test_data_files': [
101                   'base/test/data',
102                 ],
103                 'test_data_prefix' : 'ui',
104               },
105               'includes': [ '../build/copy_test_data_ios.gypi' ],
106             },
107           ],
108         }],
109         ['OS == "win"', {
110           'sources': [
111             'base/dragdrop/os_exchange_data_win_unittest.cc',
112             'base/win/hwnd_subclass_unittest.cc',
113             'gfx/font_fallback_win_unittest.cc',
114             'gfx/icon_util_unittest.cc',
115             'gfx/icon_util_unittests.rc',
116             'gfx/platform_font_win_unittest.cc',
117           ],
118           'include_dirs': [
119             '../..',
120             '../third_party/wtl/include',
121           ],
122           'msvs_settings': {
123             'VCLinkerTool': {
124               'DelayLoadDLLs': [
125                 'd2d1.dll',
126                 'd3d10_1.dll',
127               ],
128               'AdditionalDependencies': [
129                 'd2d1.lib',
130                 'd3d10_1.lib',
131               ],
132             },
133           },
134           'link_settings': {
135             'libraries': [
136               '-limm32.lib',
137               '-loleacc.lib',
138             ],
139           },
140           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
141           'msvs_disabled_warnings': [ 4267, ],
142         }],
143         ['OS == "android"', {
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:pangocairo',
151           ],
152           'conditions': [
153             ['use_allocator!="none"', {
154                'dependencies': [
155                  '../base/allocator/allocator.gyp:allocator',
156                ],
157             }],
158           ],
159         }],
160         ['use_x11==1', {
161           'dependencies': [
162             '../tools/xdisplaycheck/xdisplaycheck.gyp:xdisplaycheck',
163             'events/platform/x11/x11_events_platform.gyp:x11_events_platform',
164           ],
165         }],
166         ['OS=="android" or OS=="ios"', {
167           'sources!': [
168             'gfx/render_text_unittest.cc',
169           ],
170         }],
171         ['OS!="win" or use_aura==0', {
172           'sources!': [
173             'base/view_prop_unittest.cc',
174           ],
175         }],
176         ['use_x11==1 and use_aura==1',  {
177           'sources': [
178             'base/cursor/cursor_loader_x11_unittest.cc',
179           ],
180         }],
181         ['OS=="mac"',  {
182           'dependencies': [
183             'events/events.gyp:events_test_support',
184             'gfx/gfx.gyp:gfx_test_support',
185             'ui_unittests_bundle',
186           ],
187         }],
188         ['use_aura==1 or toolkit_views==1',  {
189           'sources': [
190             'base/dragdrop/os_exchange_data_unittest.cc',
191           ],
192           'dependencies': [
193             'events/events.gyp:events',
194             'events/events.gyp:events_base',
195             'events/events.gyp:events_test_support',
196             'events/platform/events_platform.gyp:events_platform',
197           ],
198         }],
199         ['use_aura==1', {
200           'sources!': [
201             'base/dragdrop/os_exchange_data_win_unittest.cc',
202             'gfx/screen_unittest.cc',
203           ],
204         }],
205         ['use_ozone==1', {
206           'dependencies': [
207             'gfx/ozone/gfx_ozone.gyp:gfx_ozone',
208           ],
209         }],
210         ['use_ozone==1 and use_pango==0', {
211           'sources!': [
212             'gfx/canvas_unittest.cc',
213             'gfx/render_text_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     ['OS == "android"', {
256       'targets': [
257         {
258           'target_name': 'ui_unittests_apk',
259           'type': 'none',
260           'dependencies': [
261             'ui_unittests',
262           ],
263           'variables': {
264             'test_suite_name': 'ui_unittests',
265           },
266           'includes': [ '../build/apk_test.gypi' ],
267         },
268       ],
269     }],
270   ],