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