[DevTools] Move DispatchOnDevToolsFrontend to embedder.
[chromium-blink-merge.git] / ui / ui_unittests.gyp
blobff09911d6210aaaa8d110d442d26189213d0d1d1
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         '../net/net.gyp:net',
17         '../skia/skia.gyp:skia',
18         '../testing/gmock.gyp:gmock',
19         '../testing/gtest.gyp:gtest',
20         '../third_party/icu/icu.gyp:icui18n',
21         '../third_party/icu/icu.gyp:icuuc',
22         '../url/url.gyp:url_lib',
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         'strings/ui_strings.gyp:ui_strings',
30       ],
31       # iOS uses a small subset of ui. common_sources are the only files that
32       # are built on iOS.
33       'common_sources' : [
34         'base/layout_unittest.cc',
35         'base/l10n/l10n_util_mac_unittest.mm',
36         'base/l10n/l10n_util_unittest.cc',
37         'base/l10n/l10n_util_win_unittest.cc',
38         'base/l10n/time_format_unittest.cc',
39         'base/models/tree_node_iterator_unittest.cc',
40         'base/resource/data_pack_literal.cc',
41         'base/resource/data_pack_unittest.cc',
42         'base/resource/resource_bundle_unittest.cc',
43         'base/test/run_all_unittests.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/ime/candidate_window_unittest.cc',
63         'base/ime/chromeos/character_composer_unittest.cc',
64         'base/ime/composition_text_util_pango_unittest.cc',
65         'base/ime/input_method_base_unittest.cc',
66         'base/ime/input_method_chromeos_unittest.cc',
67         'base/ime/remote_input_method_win_unittest.cc',
68         'base/ime/win/imm32_manager_unittest.cc',
69         'base/ime/win/tsf_input_scope_unittest.cc',
70         'base/models/list_model_unittest.cc',
71         'base/models/list_selection_model_unittest.cc',
72         'base/models/tree_node_model_unittest.cc',
73         'base/test/data/resource.h',
74         'base/text/bytes_formatting_unittest.cc',
75         'base/view_prop_unittest.cc',
76         'base/webui/web_ui_util_unittest.cc',
77         'base/x/selection_requestor_unittest.cc',
78       ],
79       'include_dirs': [
80         '../',
81       ],
82       'conditions': [
83         ['OS!="ios"', {
84           'sources' : ['<@(_all_sources)'],
85         }, {  # OS=="ios"
86           'sources' : [
87             '<@(_common_sources)',
88           ],
89           # The ResourceBundle unittest expects a locale.pak file to exist in
90           # the bundle for English-US. Copy it in from where it was generated
91           # by ui_resources.gyp:ui_test_pak.
92           'mac_bundle_resources': [
93             '<(PRODUCT_DIR)/ui/en.lproj/locale.pak',
94           ],
95           'actions': [
96             {
97               'action_name': 'copy_test_data',
98               'variables': {
99                 'test_data_files': [
100                   'base/test/data',
101                 ],
102                 'test_data_prefix' : 'ui',
103               },
104               'includes': [ '../build/copy_test_data_ios.gypi' ],
105             },
106           ],
107         }],
108         ['OS == "win"', {
109           'sources': [
110             'base/dragdrop/os_exchange_data_win_unittest.cc',
111             'base/win/hwnd_subclass_unittest.cc',
112             'base/win/open_file_name_win_unittest.cc',
113             'gfx/color_profile_win_unittest.cc',
114             'gfx/font_fallback_win_unittest.cc',
115             'gfx/icon_util_unittest.cc',
116             'gfx/icon_util_unittests.rc',
117             'gfx/platform_font_win_unittest.cc',
118           ],
119           'include_dirs': [
120             '../..',
121             '../third_party/wtl/include',
122           ],
123           'msvs_settings': {
124             'VCLinkerTool': {
125               'DelayLoadDLLs': [
126                 'd2d1.dll',
127                 'd3d10_1.dll',
128               ],
129               'AdditionalDependencies': [
130                 'd2d1.lib',
131                 'd3d10_1.lib',
132               ],
133             },
134           },
135           'link_settings': {
136             'libraries': [
137               '-limm32.lib',
138               '-loleacc.lib',
139             ],
140           },
141           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
142           'msvs_disabled_warnings': [ 4267, ],
143         }],
144         ['OS == "android"', {
145           'dependencies': [
146             '../testing/android/native_test.gyp:native_test_native_code',
147           ],
148         }],
149         ['use_pango == 1', {
150           'dependencies': [
151             '../build/linux/system.gyp:pangocairo',
152           ],
153           'conditions': [
154             ['use_allocator!="none"', {
155                'dependencies': [
156                  '../base/allocator/allocator.gyp:allocator',
157                ],
158             }],
159           ],
160         }],
161         ['use_x11==1', {
162           'dependencies': [
163             '../tools/xdisplaycheck/xdisplaycheck.gyp:xdisplaycheck',
164             'events/platform/x11/x11_events_platform.gyp:x11_events_platform',
165           ],
166         }],
167         ['OS!="win" or use_aura==0', {
168           'sources!': [
169             'base/view_prop_unittest.cc',
170           ],
171         }],
172         ['use_x11==1 and use_aura==1',  {
173           'sources': [
174             'base/cursor/cursor_loader_x11_unittest.cc',
175           ],
176         }],
177         ['OS=="mac"',  {
178           'dependencies': [
179             '../third_party/mozilla/mozilla.gyp:mozilla',
180             'events/events.gyp:events_test_support',
181             'ui_unittests_bundle',
182           ],
183           'conditions': [
184             ['component=="static_library"', {
185               # Needed for mozilla.gyp.
186               'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
187             }],
188           ],
189         }],
190         ['use_aura==1 or toolkit_views==1',  {
191           'sources': [
192             'base/dragdrop/os_exchange_data_unittest.cc',
193           ],
194           'dependencies': [
195             'events/events.gyp:events',
196             'events/events.gyp:events_base',
197             'events/events.gyp:events_test_support',
198             'events/platform/events_platform.gyp:events_platform',
199           ],
200         }],
201         ['use_aura==1', {
202           'sources!': [
203             'base/dragdrop/os_exchange_data_win_unittest.cc',
204           ],
205         }],
206         ['chromeos==1', {
207           'dependencies': [
208             '../chromeos/chromeos.gyp:chromeos',
209             'aura/aura.gyp:aura_test_support',
210             'chromeos/ui_chromeos.gyp:ui_chromeos',
211             'events/events.gyp:gesture_detection',
212           ],
213           'sources': [
214             'chromeos/touch_exploration_controller_unittest.cc'
215           ],
216           'sources!': [
217             'base/dragdrop/os_exchange_data_provider_aurax11_unittest.cc',
218             'base/x/selection_requestor_unittest.cc',
219           ],
220         }],
221         ['chromeos==0 or use_x11==0', {
222           'sources!': [
223             'base/ime/chromeos/character_composer_unittest.cc',
224             'base/ime/input_method_chromeos_unittest.cc',
225           ],
226         }],
227         ['use_x11==0', {
228           'sources!': [
229             'base/ime/composition_text_util_pango_unittest.cc',
230           ],
231         }],
232       ],
233       'target_conditions': [
234         ['OS == "ios"', {
235           'sources/': [
236             # Pull in specific Mac files for iOS (which have been filtered out
237             # by file name rules).
238             ['include', '^base/l10n/l10n_util_mac_unittest\\.mm$'],
239           ],
240         }],
241       ],
242     },
243   ],
244   'conditions': [
245     # Mac target to build a test Framework bundle to mock out resource loading.
246     ['OS == "mac"', {
247       'targets': [
248         {
249           'target_name': 'ui_unittests_bundle',
250           'type': 'shared_library',
251           'dependencies': [
252             'resources/ui_resources.gyp:ui_test_pak',
253           ],
254           'includes': [ 'ui_unittests_bundle.gypi' ],
255         },
256       ],
257     }],
258     ['OS == "android"', {
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   ],