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