Revert of Split ui/base/ime into a new component (patchset #4 id:60001 of https:...
[chromium-blink-merge.git] / ui / base / ui_base_tests.gyp
blob287761d4746cbc06a349ec132f57e50390acb789
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       # GN version: //ui/base:unittests
12       'target_name': 'ui_base_unittests',
13       'type': '<(gtest_target_type)',
14       'dependencies': [
15         '../../base/base.gyp:base',
16         '../../base/base.gyp:test_support_base',
17         '../../net/net.gyp:net',
18         '../../skia/skia.gyp:skia',
19         '../../testing/gmock.gyp:gmock',
20         '../../testing/gtest.gyp:gtest',
21         '../../third_party/icu/icu.gyp:icui18n',
22         '../../third_party/icu/icu.gyp:icuuc',
23         '../../url/url.gyp:url_lib',
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         'ui_base.gyp:ui_base',
30         'ui_base.gyp:ui_base_test_support',
31       ],
32       # iOS uses a small subset of ui. common_sources are the only files that
33       # are built on iOS.
34       'common_sources' : [
35         # Note: file list duplicated in GN build.
36         'layout_unittest.cc',
37         'l10n/l10n_util_mac_unittest.mm',
38         'l10n/l10n_util_unittest.cc',
39         'l10n/l10n_util_win_unittest.cc',
40         'l10n/time_format_unittest.cc',
41         'models/tree_node_iterator_unittest.cc',
42         'resource/data_pack_literal.cc',
43         'resource/data_pack_unittest.cc',
44         'resource/resource_bundle_unittest.cc',
45         'test/run_all_unittests.cc',
46       ],
47       'all_sources': [
48         # Note: file list duplicated in GN build.
49         '<@(_common_sources)',
50         'accelerators/accelerator_manager_unittest.cc',
51         'accelerators/menu_label_accelerator_util_linux_unittest.cc',
52         'clipboard/custom_data_helper_unittest.cc',
53         'cocoa/base_view_unittest.mm',
54         'cocoa/cocoa_base_utils_unittest.mm',
55         'cocoa/controls/blue_label_button_unittest.mm',
56         'cocoa/controls/hover_image_menu_button_unittest.mm',
57         'cocoa/controls/hyperlink_button_cell_unittest.mm',
58         'cocoa/controls/hyperlink_text_view_unittest.mm',
59         'cocoa/focus_tracker_unittest.mm',
60         'cocoa/fullscreen_window_manager_unittest.mm',
61         'cocoa/hover_image_button_unittest.mm',
62         'cocoa/menu_controller_unittest.mm',
63         'cocoa/nsgraphics_context_additions_unittest.mm',
64         'cocoa/nsview_additions_unittest.mm',
65         'cocoa/tracking_area_unittest.mm',
66         'dragdrop/os_exchange_data_provider_aurax11_unittest.cc',
67         'ime/candidate_window_unittest.cc',
68         'ime/chromeos/character_composer_unittest.cc',
69         'ime/composition_text_util_pango_unittest.cc',
70         'ime/input_method_base_unittest.cc',
71         'ime/input_method_chromeos_unittest.cc',
72         'ime/remote_input_method_win_unittest.cc',
73         'ime/win/imm32_manager_unittest.cc',
74         'ime/win/tsf_input_scope_unittest.cc',
75         'models/list_model_unittest.cc',
76         'models/list_selection_model_unittest.cc',
77         'models/tree_node_model_unittest.cc',
78         'test/test_clipboard_unittest.cc',
79         'test/data/resource.h',
80         'text/bytes_formatting_unittest.cc',
81         'touch/selection_bound_unittest.cc',
82         'user_activity/user_activity_detector_unittest.cc',
83         'view_prop_unittest.cc',
84         'webui/web_ui_util_unittest.cc',
85         'x/selection_requestor_unittest.cc',
86       ],
87       'include_dirs': [
88         '../..',
89       ],
90       'conditions': [
91         ['OS!="ios"', {
92           'sources' : [ '<@(_all_sources)' ],
93         }, {  # OS=="ios"
94           'sources' : [ '<@(_common_sources)' ],
95           # The ResourceBundle unittest expects a locale.pak file to exist in
96           # the bundle for English-US. Copy it in from where it was generated
97           # by ui_resources.gyp:ui_test_pak.
98           'mac_bundle_resources': [
99             '<(PRODUCT_DIR)/ui/en.lproj/locale.pak',
100           ],
101           'actions': [
102             {
103               'action_name': 'copy_test_data',
104               'variables': {
105                 'test_data_files': [
106                   'test/data',
107                 ],
108                 'test_data_prefix' : 'ui/base',
109               },
110               'includes': [ '../../build/copy_test_data_ios.gypi' ],
111             },
112           ],
113         }],
114         ['OS == "win"', {
115           'sources': [
116             'dragdrop/os_exchange_data_win_unittest.cc',
117             'win/hwnd_subclass_unittest.cc',
118             'win/open_file_name_win_unittest.cc',
119           ],
120           'msvs_settings': {
121             'VCLinkerTool': {
122               'DelayLoadDLLs': [
123                 'd2d1.dll',
124                 'd3d10_1.dll',
125               ],
126               'AdditionalDependencies': [
127                 'd2d1.lib',
128                 'd3d10_1.lib',
129               ],
130             },
131           },
132           'link_settings': {
133             'libraries': [
134               '-limm32.lib',
135               '-loleacc.lib',
136             ],
137           },
138           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
139           'msvs_disabled_warnings': [ 4267, ],
140         }],
141         ['OS == "android"', {
142           'dependencies': [
143             '../../testing/android/native_test.gyp:native_test_native_code',
144           ],
145           'sources!': [
146             'touch/selection_bound_unittest.cc',
147             'user_activity/user_activity_detector_unittest.cc',
148           ],
149         }],
150         ['use_pango == 1', {
151           'dependencies': [
152             '../../build/linux/system.gyp:pangocairo',
153           ],
154           'conditions': [
155             ['use_allocator!="none"', {
156               'dependencies': [
157                 '../../base/allocator/allocator.gyp:allocator',
158               ],
159             }],
160           ],
161         }],
162         ['use_x11==1', {
163           'dependencies': [
164             '../../build/linux/system.gyp:x11',
165             '../../tools/xdisplaycheck/xdisplaycheck.gyp:xdisplaycheck',
166             '../events/platform/x11/x11_events_platform.gyp:x11_events_platform',
167             '../gfx/x/gfx_x11.gyp:gfx_x11',
168           ],
169         }],
170         ['OS!="win" or use_aura==0', {
171           'sources!': [
172             'view_prop_unittest.cc',
173           ],
174         }],
175         ['use_x11==1 and use_aura==1',  {
176           'sources': [
177             'cursor/cursor_loader_x11_unittest.cc',
178           ],
179         }],
180         ['OS=="mac"',  {
181           'dependencies': [
182             '../../third_party/mozilla/mozilla.gyp:mozilla',
183             '../events/events.gyp:events_test_support',
184             'ui_base_tests_bundle',
185           ],
186           'conditions': [
187             ['component=="static_library"', {
188               # Needed for mozilla.gyp.
189               'xcode_settings': {'OTHER_LDFLAGS': ['-Wl,-ObjC']},
190             }],
191           ],
192         }],
193         ['use_aura==1 or toolkit_views==1',  {
194           'sources': [
195             'dragdrop/os_exchange_data_unittest.cc',
196           ],
197           'dependencies': [
198             '../events/events.gyp:events',
199             '../events/events.gyp:events_base',
200             '../events/events.gyp:events_test_support',
201             '../events/platform/events_platform.gyp:events_platform',
202           ],
203         }],
204         ['chromeos==1', {
205           'dependencies': [
206             '../../chromeos/chromeos.gyp:chromeos',
207           ],
208           'sources!': [
209             'dragdrop/os_exchange_data_provider_aurax11_unittest.cc',
210             'x/selection_requestor_unittest.cc',
211           ],
212         }],
213         ['use_x11==0', {
214           'sources!': [
215             'ime/chromeos/character_composer_unittest.cc',
216             'ime/input_method_chromeos_unittest.cc',
217             'ime/composition_text_util_pango_unittest.cc',
218           ],
219         }],
220       ],
221       'target_conditions': [
222         ['OS == "ios"', {
223           'sources/': [
224             # Pull in specific Mac files for iOS (which have been filtered out
225             # by file name rules).
226             ['include', '^l10n/l10n_util_mac_unittest\\.mm$'],
227           ],
228         }],
229       ],
230     },
231   ],
232   'conditions': [
233     # Mac target to build a test Framework bundle to mock out resource loading.
234     ['OS == "mac"', {
235       'targets': [
236         {
237           'target_name': 'ui_base_tests_bundle',
238           'type': 'shared_library',
239           'dependencies': [
240             '../resources/ui_resources.gyp:ui_test_pak',
241           ],
242           'includes': [ 'ui_base_tests_bundle.gypi' ],
243           # ui_base_tests_bundle doesn't actually contain a shared library and
244           # therefore should not depend on sanitizer_options or any other
245           # libraries. Adding such a dependency will result in creating a
246           # broken shared library within the bundle.
247           'conditions': [
248             ['use_sanitizer_options==1', {
249               'dependencies!': [
250                 '../../build/sanitizers/sanitizers.gyp:sanitizer_options',
251               ],
252             }],
253           ],
254         },
255       ],
256     }],
257     ['OS == "android"', {
258       'targets': [
259         {
260           'target_name': 'ui_base_unittests_apk',
261           'type': 'none',
262           'dependencies': [
263             # TODO(tfarina): This is a layer violation and should be removed.
264             # crbug.com/176960
265             # For now this is here as a temporary band-aid to fix the clobber
266             # issue we are seeing when running this target on Android.
267             # crbug.com/374490
268             '../../chrome/chrome_resources.gyp:packed_resources',
269             'ui_base_unittests',
270           ],
271           'variables': {
272             'test_suite_name': 'ui_base_unittests',
273           },
274           'includes': [ '../../build/apk_test.gypi' ],
275         },
276       ],
277     }],
278     ['test_isolation_mode != "noop"', {
279       'targets': [
280         {
281           'target_name': 'ui_base_unittests_run',
282           'type': 'none',
283           'dependencies': [
284             'ui_base_unittests',
285           ],
286           'includes': [
287             '../../build/isolate.gypi',
288           ],
289           'sources': [
290             'ui_base_unittests.isolate',
291           ],
292           'conditions': [
293             ['use_x11 == 1', {
294               'dependencies': [
295                 '../../tools/xdisplaycheck/xdisplaycheck.gyp:xdisplaycheck',
296               ],
297             }],
298           ],
299         },
300       ],
301     }],
302   ],