Separate Simple Backend creation from initialization.
[chromium-blink-merge.git] / ui / ui_unittests.gypi
blob114ad63360974f708117e87fc2dd1be4e3d617d1
1 # Copyright (c) 2012 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   'targets': [
7     {
8       'target_name': 'ui_test_support',
9       'type': 'static_library',
10       'dependencies': [
11         '../base/base.gyp:base',
12         '../skia/skia.gyp:skia',
13         '../testing/gtest.gyp:gtest',
14       ],
15       'sources': [
16         'base/test/cocoa_test_event_utils.h',
17         'base/test/cocoa_test_event_utils.mm',
18         'base/test/ui_cocoa_test_helper.h',
19         'base/test/ui_cocoa_test_helper.mm',
20         'base/test/dummy_input_method.cc',
21         'base/test/dummy_input_method.h',
22       ],
23       'include_dirs': [
24         '../',
25       ],
26       'conditions': [
27         ['OS!="ios"', {
28           'includes': [ 'base/ime/ime_test_support.gypi' ],
29         }, {  # OS=="ios"
30           # The cocoa files don't apply to iOS.
31           'sources/': [['exclude', 'cocoa']],
32         }],
33         ['chromeos==1', {
34           'dependencies': [
35             '../chromeos/chromeos.gyp:chromeos_test_support_without_gmock',
36             '../skia/skia.gyp:skia',
37           ],
38         }],
39       ],
40     },
41     {
42       'target_name': 'run_ui_unittests',
43       'type': 'static_library',
44       'dependencies': [
45         '../base/base.gyp:base',
46         '../base/base.gyp:test_support_base',
47         'ui',
48       ],
49       'sources': [
50         'test/test_suite.cc',
51         'test/test_suite.h',
52         'test/run_all_unittests.cc',
53       ],
54     },
55     {
56       'target_name': 'ui_unittests',
57       'type': '<(gtest_target_type)',
58       'dependencies': [
59         '../base/base.gyp:base',
60         '../base/base.gyp:test_support_base',
61         '../build/temp_gyp/googleurl.gyp:googleurl',
62         '../skia/skia.gyp:skia',
63         '../testing/gmock.gyp:gmock',
64         '../testing/gtest.gyp:gtest',
65         '../third_party/icu/icu.gyp:icui18n',
66         '../third_party/icu/icu.gyp:icuuc',
67         '../third_party/libpng/libpng.gyp:libpng',
68         'run_ui_unittests',
69         'shell_dialogs',
70         'ui',
71         'ui_resources',
72         'ui_test_support',
73       ],
74       # iOS uses a small subset of ui. common_sources are the only files that
75       # are built on iOS.
76       'common_sources' : [
77         'base/animation/animation_container_unittest.cc',
78         'base/animation/animation_unittest.cc',
79         'base/animation/multi_animation_unittest.cc',
80         'base/animation/slide_animation_unittest.cc',
81         'base/layout_unittest.cc',
82         'base/l10n/l10n_util_mac_unittest.mm',
83         'base/l10n/l10n_util_unittest.cc',
84         'base/l10n/l10n_util_win_unittest.cc',
85         'base/models/tree_node_iterator_unittest.cc',
86         'base/range/range_mac_unittest.mm',
87         'base/range/range_unittest.cc',
88         'base/range/range_win_unittest.cc',
89         'base/resource/data_pack_literal.cc',
90         'base/resource/data_pack_unittest.cc',
91         'base/resource/resource_bundle_unittest.cc',
92         'base/text/text_elider_unittest.cc',
93         'gfx/codec/png_codec_unittest.cc',
94         'gfx/color_utils_unittest.cc',
95         'gfx/display_unittest.cc',
96         'gfx/font_unittest.cc',
97         'gfx/image/image_family_unittest.cc',
98         'gfx/image/image_skia_unittest.cc',
99         'gfx/image/image_unittest.cc',
100         'gfx/image/image_unittest_util.cc',
101         'gfx/image/image_unittest_util.h',
102         'gfx/image/image_unittest_util_ios.mm',
103         'gfx/image/image_unittest_util_mac.mm',
104         'gfx/insets_unittest.cc',
105         'gfx/matrix3_unittest.cc',
106         'gfx/point_unittest.cc',
107         'gfx/point3_unittest.cc',
108         'gfx/quad_unittest.cc',
109         'gfx/rect_unittest.cc',
110         'gfx/safe_integer_conversions_unittest.cc',
111         'gfx/screen_unittest.cc',
112         'gfx/shadow_value_unittest.cc',
113         'gfx/size_unittest.cc',
114         'gfx/skbitmap_operations_unittest.cc',
115         'gfx/text_utils_unittest.cc',
116         'gfx/vector2d_unittest.cc',
117         'gfx/vector3d_unittest.cc',
118       ],
119       'all_sources': [
120         '<@(_common_sources)',
121         'base/accelerators/accelerator_manager_unittest.cc',
122         'base/clipboard/clipboard_unittest.cc',
123         'base/clipboard/custom_data_helper_unittest.cc',
124         'base/cocoa/base_view_unittest.mm',
125         'base/cocoa/events_mac_unittest.mm',
126         'base/cocoa/focus_tracker_unittest.mm',
127         'base/cocoa/fullscreen_window_manager_unittest.mm',
128         'base/cocoa/hover_image_button_unittest.mm',
129         'base/cocoa/tracking_area_unittest.mm',
130         'base/events/event_dispatcher_unittest.cc',
131         'base/events/event_unittest.cc',
132         'base/gtk/gtk_expanded_container_unittest.cc',
133         'base/gtk/gtk_im_context_util_unittest.cc',
134         'base/gtk/menu_label_accelerator_util_unittest.cc',
135         'base/keycodes/usb_keycode_map_unittest.cc',
136         'base/models/list_model_unittest.cc',
137         'base/models/list_selection_model_unittest.cc',
138         'base/models/tree_node_model_unittest.cc',
139         'base/test/data/resource.h',
140         'base/text/bytes_formatting_unittest.cc',
141         'base/text/utf16_indexing_unittest.cc',
142         'base/view_prop_unittest.cc',
143         'gfx/blit_unittest.cc',
144         'gfx/break_list_unittest.cc',
145         'gfx/canvas_unittest.cc',
146         'gfx/codec/jpeg_codec_unittest.cc',
147         'gfx/color_analysis_unittest.cc',
148         'gfx/font_list_unittest.cc',
149         'gfx/image/image_mac_unittest.mm',
150         'gfx/image/image_util_unittest.cc',
151         'gfx/platform_font_mac_unittest.mm',
152         'gfx/render_text_unittest.cc',
153         'gfx/transform_util_unittest.cc',
154         'gfx/video_decode_acceleration_support_mac_unittest.mm',
155         'shell_dialogs/select_file_dialog_win_unittest.cc',
156         'webui/web_ui_util_unittest.cc',
157       ],
158       'include_dirs': [
159         '../',
160       ],
161       'conditions': [
162         ['OS!="ios"', {
163           'sources' : ['<@(_all_sources)'],
164           'includes': [
165             'base/ime/ime_unittests.gypi',
166           ],
167         }, {  # OS=="ios"
168           'sources' : [
169             '<@(_common_sources)',
170           ],
171           # The ResourceBundle unittest expects a locale.pak file to exist in
172           # the bundle for English-US. Copy it in from where it was generated
173           # by ui_strings.gyp:ui_unittest_strings.
174           'mac_bundle_resources': [
175             '<(PRODUCT_DIR)/ui_unittests_strings/en.lproj/locale.pak',
176           ],
177         }],
178         ['OS == "win"', {
179           'sources': [
180             'test/ui_unittests.rc',
181             'base/dragdrop/os_exchange_data_win_unittest.cc',
182             'base/win/hwnd_subclass_unittest.cc',
183             'gfx/font_fallback_win_unittest.cc',
184             'gfx/icon_util_unittest.cc',
185             'gfx/platform_font_win_unittest.cc',
186           ],
187           'include_dirs': [
188             '../..',
189             '../third_party/wtl/include',
190           ],
191           'msvs_settings': {
192             'VCLinkerTool': {
193               'DelayLoadDLLs': [
194                 'd2d1.dll',
195                 'd3d10_1.dll',
196               ],
197               'AdditionalDependencies': [
198                 'd2d1.lib',
199                 'd3d10_1.lib',
200               ],
201             },
202           },
203           'link_settings': {
204             'libraries': [
205               '-limm32.lib',
206               '-loleacc.lib',
207             ],
208           },
209           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
210           'msvs_disabled_warnings': [ 4267, ],
211         }],
212         ['OS == "linux"', {
213           'sources': [
214             'base/x/x11_util_unittest.cc',
215             'gfx/platform_font_pango_unittest.cc',
216           ],
217         }],
218         ['OS == "linux" and toolkit_views==1', {
219           'sources': [
220             'base/x/events_x_unittest.cc',
221           ],
222         }],
223         ['OS != "mac" and OS != "ios"', {
224           'sources': [
225             'gfx/transform_unittest.cc',
226             'gfx/interpolated_transform_unittest.cc',
227           ],
228         }],
229         ['OS == "android" and gtest_target_type == "shared_library"', {
230           'dependencies': [
231             '../testing/android/native_test.gyp:native_test_native_code',
232           ],
233         }],
234         ['use_glib == 1 or OS == "ios"', {
235           'dependencies': [
236             'base/strings/ui_strings.gyp:ui_unittest_strings',
237           ],
238         }],
239         ['use_glib == 1', {
240           'dependencies': [
241             '../build/linux/system.gyp:pangocairo',
242           ],
243           'conditions': [
244             ['linux_use_tcmalloc==1', {
245                'dependencies': [
246                  '../base/allocator/allocator.gyp:allocator',
247                ],
248             }],
249             ['toolkit_views==1', {
250               'sources!': [
251                 'browser/ui/gtk/gtk_expanded_container_unittest.cc',
252               ],
253             }],
254           ],
255         }],
256         ['use_x11==1', {
257           'dependencies': [
258             '../tools/xdisplaycheck/xdisplaycheck.gyp:xdisplaycheck',
259           ],
260         }],
261         ['toolkit_uses_gtk == 1', {
262           'sources': [
263             'base/dragdrop/gtk_dnd_util_unittest.cc',
264           ],
265           'dependencies': [
266             '../build/linux/system.gyp:gtk',
267           ],
268         }],
269         ['OS=="android" or OS=="ios"', {
270           'sources!': [
271             'gfx/render_text_unittest.cc',
272           ],
273         }],
274         ['OS!="win" or use_aura==0', {
275           'sources!': [
276             'base/view_prop_unittest.cc',
277           ],
278         }],
279         ['use_aura==1 or toolkit_views==1',  {
280           'sources': [
281             'base/gestures/velocity_calculator_unittest.cc',
282           ],
283         }, {
284           'sources!': [
285             'base/events/event_dispatcher_unittest.cc',
286             'base/events/event_unittest.cc',
287           ],
288         }],
289         ['use_aura==1', {
290           'sources!': [
291             'base/dialogs/select_file_dialog_win_unittest.cc',
292             'base/dragdrop/os_exchange_data_win_unittest.cc',
293             'gfx/screen_unittest.cc',
294           ],
295         }],
296       ],
297       'target_conditions': [
298         ['OS == "ios"', {
299           'sources/': [
300             # Pull in specific Mac files for iOS (which have been filtered out
301             # by file name rules).
302             ['include', '^base/l10n/l10n_util_mac_unittest\\.mm$'],
303           ],
304         }],
305       ],
306     },
307   ],
308   'conditions': [
309     # Special target to wrap a gtest_target_type==shared_library
310     # ui_unittests into an android apk for execution.
311     # See base.gyp for TODO(jrg)s about this strategy.
312     ['OS == "android" and gtest_target_type == "shared_library"', {
313       'targets': [
314         {
315           'target_name': 'ui_unittests_apk',
316           'type': 'none',
317           'dependencies': [
318             'ui_unittests',
319           ],
320           'variables': {
321             'test_suite_name': 'ui_unittests',
322             'input_shlib_path': '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)ui_unittests<(SHARED_LIB_SUFFIX)',
323           },
324           'includes': [ '../build/apk_test.gypi' ],
325         },
326       ],
327     }],
328   ],