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