Add ICU message format support
[chromium-blink-merge.git] / ui / base / BUILD.gn
blob15ad86c835b844328f628e0acf325ae16b329a6b
1 # Copyright 2014 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.
5 import("//build/config/ui.gni")
6 import("//testing/test.gni")
8 if (is_android) {
9   import("//build/config/android/config.gni")
10   import("//build/config/android/rules.gni")
13 build_ime = !is_ios
15 component("base") {
16   output_name = "ui_base"
17   sources = [
18     "accelerators/accelerator.cc",
19     "accelerators/accelerator.h",
20     "accelerators/accelerator_history.cc",
21     "accelerators/accelerator_history.h",
22     "accelerators/accelerator_manager.cc",
23     "accelerators/accelerator_manager.h",
24     "accelerators/menu_label_accelerator_util_linux.cc",
25     "accelerators/menu_label_accelerator_util_linux.h",
26     "accelerators/platform_accelerator.h",
27     "accelerators/platform_accelerator_cocoa.h",
28     "accelerators/platform_accelerator_cocoa.mm",
29     "android/ui_base_jni_registrar.cc",
30     "android/ui_base_jni_registrar.h",
31     "base_window.cc",
32     "base_window.h",
33     "clipboard/clipboard.cc",
34     "clipboard/clipboard.h",
35     "clipboard/clipboard_android.cc",
36     "clipboard/clipboard_android.h",
37     "clipboard/clipboard_constants.cc",
38     "clipboard/clipboard_mac.h",
39     "clipboard/clipboard_mac.mm",
40     "clipboard/clipboard_types.h",
41     "clipboard/clipboard_util_win.cc",
42     "clipboard/clipboard_util_win.h",
43     "clipboard/clipboard_win.cc",
44     "clipboard/clipboard_win.h",
45     "clipboard/custom_data_helper.cc",
46     "clipboard/custom_data_helper.h",
47     "clipboard/custom_data_helper_linux.cc",
48     "clipboard/custom_data_helper_mac.mm",
49     "clipboard/scoped_clipboard_writer.cc",
50     "clipboard/scoped_clipboard_writer.h",
51     "cocoa/animation_utils.h",
52     "cocoa/appkit_utils.h",
53     "cocoa/appkit_utils.mm",
54     "cocoa/base_view.h",
55     "cocoa/base_view.mm",
56     "cocoa/cocoa_base_utils.h",
57     "cocoa/cocoa_base_utils.mm",
58     "cocoa/constrained_window/constrained_window_animation.h",
59     "cocoa/constrained_window/constrained_window_animation.mm",
60     "cocoa/controls/blue_label_button.h",
61     "cocoa/controls/blue_label_button.mm",
62     "cocoa/controls/hover_image_menu_button.h",
63     "cocoa/controls/hover_image_menu_button.mm",
64     "cocoa/controls/hover_image_menu_button_cell.h",
65     "cocoa/controls/hover_image_menu_button_cell.mm",
66     "cocoa/controls/hyperlink_button_cell.h",
67     "cocoa/controls/hyperlink_button_cell.mm",
68     "cocoa/controls/hyperlink_text_view.h",
69     "cocoa/controls/hyperlink_text_view.mm",
70     "cocoa/find_pasteboard.h",
71     "cocoa/find_pasteboard.mm",
72     "cocoa/flipped_view.h",
73     "cocoa/flipped_view.mm",
74     "cocoa/focus_tracker.h",
75     "cocoa/focus_tracker.mm",
76     "cocoa/focus_window_set.h",
77     "cocoa/focus_window_set.mm",
78     "cocoa/fullscreen_window_manager.h",
79     "cocoa/fullscreen_window_manager.mm",
80     "cocoa/hover_button.h",
81     "cocoa/hover_button.mm",
82     "cocoa/hover_image_button.h",
83     "cocoa/hover_image_button.mm",
84     "cocoa/menu_controller.h",
85     "cocoa/menu_controller.mm",
86     "cocoa/nib_loading.h",
87     "cocoa/nib_loading.mm",
88     "cocoa/nsgraphics_context_additions.h",
89     "cocoa/nsgraphics_context_additions.mm",
90     "cocoa/nsview_additions.h",
91     "cocoa/nsview_additions.mm",
92     "cocoa/remote_layer_api.h",
93     "cocoa/remote_layer_api.mm",
94     "cocoa/three_part_image.h",
95     "cocoa/three_part_image.mm",
96     "cocoa/tool_tip_base_view.h",
97     "cocoa/tool_tip_base_view.mm",
98     "cocoa/tracking_area.h",
99     "cocoa/tracking_area.mm",
100     "cocoa/underlay_opengl_hosting_window.h",
101     "cocoa/underlay_opengl_hosting_window.mm",
102     "cocoa/view_description.h",
103     "cocoa/view_description.mm",
104     "cocoa/window_size_constants.h",
105     "cocoa/window_size_constants.mm",
106     "cursor/cursor.cc",
107     "cursor/cursor.h",
108     "cursor/cursor_android.cc",
109     "cursor/cursor_loader.h",
110     "cursor/cursor_util.cc",
111     "cursor/cursor_util.h",
112     "cursor/cursor_win.cc",
113     "cursor/cursors_aura.cc",
114     "cursor/cursors_aura.h",
115     "cursor/image_cursors.cc",
116     "cursor/image_cursors.h",
117     "default_theme_provider.cc",
118     "default_theme_provider.h",
119     "default_theme_provider_mac.mm",
120     "device_form_factor.h",
121     "device_form_factor_android.cc",
122     "device_form_factor_android.h",
123     "device_form_factor_desktop.cc",
124     "device_form_factor_ios.mm",
125     "dragdrop/cocoa_dnd_util.h",
126     "dragdrop/cocoa_dnd_util.mm",
127     "dragdrop/drag_drop_types.h",
128     "dragdrop/drag_drop_types_win.cc",
129     "dragdrop/drag_source_win.cc",
130     "dragdrop/drag_source_win.h",
131     "dragdrop/drag_utils.cc",
132     "dragdrop/drag_utils.h",
133     "dragdrop/drag_utils_aura.cc",
134     "dragdrop/drag_utils_mac.mm",
135     "dragdrop/drag_utils_win.cc",
136     "dragdrop/drop_target_event.cc",
137     "dragdrop/drop_target_event.h",
138     "dragdrop/drop_target_win.cc",
139     "dragdrop/drop_target_win.h",
140     "dragdrop/file_info.cc",
141     "dragdrop/file_info.h",
142     "dragdrop/os_exchange_data.cc",
143     "dragdrop/os_exchange_data.h",
144     "dragdrop/os_exchange_data_provider_mac.h",
145     "dragdrop/os_exchange_data_provider_mac.mm",
146     "dragdrop/os_exchange_data_provider_win.cc",
147     "dragdrop/os_exchange_data_provider_win.h",
148     "hit_test.h",
149     "idle/idle.cc",
150     "idle/idle.h",
151     "idle/idle_chromeos.cc",
152     "idle/idle_linux.cc",
153     "idle/idle_mac.mm",
154     "idle/idle_win.cc",
155     "ios/cru_context_menu_controller.h",
156     "ios/cru_context_menu_controller.mm",
157     "ios/cru_context_menu_holder.h",
158     "ios/cru_context_menu_holder.mm",
159     "l10n/formatter.cc",
160     "l10n/formatter.h",
161     "l10n/l10n_font_util.cc",
162     "l10n/l10n_font_util.h",
163     "l10n/l10n_util.cc",
164     "l10n/l10n_util.h",
165     "l10n/l10n_util_android.cc",
166     "l10n/l10n_util_android.h",
167     "l10n/l10n_util_collator.h",
168     "l10n/l10n_util_mac.h",
169     "l10n/l10n_util_mac.mm",
170     "l10n/l10n_util_posix.cc",
171     "l10n/l10n_util_win.cc",
172     "l10n/l10n_util_win.h",
173     "l10n/time_format.cc",
174     "l10n/time_format.h",
175     "layout.cc",
176     "layout.h",
177     "layout_mac.mm",
178     "models/button_menu_item_model.cc",
179     "models/button_menu_item_model.h",
180     "models/combobox_model.cc",
181     "models/combobox_model.h",
182     "models/combobox_model_observer.h",
183     "models/dialog_model.cc",
184     "models/dialog_model.h",
185     "models/list_model.h",
186     "models/list_model_observer.h",
187     "models/list_selection_model.cc",
188     "models/list_selection_model.h",
189     "models/menu_model.cc",
190     "models/menu_model.h",
191     "models/menu_model_delegate.h",
192     "models/menu_separator_types.h",
193     "models/simple_combobox_model.cc",
194     "models/simple_combobox_model.h",
195     "models/simple_menu_model.cc",
196     "models/simple_menu_model.h",
197     "models/table_model.cc",
198     "models/table_model.h",
199     "models/table_model_observer.h",
200     "models/tree_model.cc",
201     "models/tree_model.h",
202     "models/tree_node_iterator.h",
203     "models/tree_node_model.h",
204     "nine_image_painter_factory.cc",
205     "nine_image_painter_factory.h",
206     "page_transition_types.cc",
207     "page_transition_types.h",
208     "resource/data_pack.cc",
209     "resource/data_pack.h",
210     "resource/material_design/material_design_controller.cc",
211     "resource/material_design/material_design_controller.h",
212     "resource/resource_bundle.cc",
213     "resource/resource_bundle.h",
214     "resource/resource_bundle_android.cc",
215     "resource/resource_bundle_auralinux.cc",
216     "resource/resource_bundle_ios.mm",
217     "resource/resource_bundle_mac.mm",
218     "resource/resource_bundle_win.cc",
219     "resource/resource_bundle_win.h",
220     "resource/resource_data_dll_win.cc",
221     "resource/resource_data_dll_win.h",
222     "resource/resource_handle.h",
223     "template_expressions.cc",
224     "template_expressions.h",
225     "text/bytes_formatting.cc",
226     "text/bytes_formatting.h",
227     "theme_provider.cc",
228     "theme_provider.h",
229     "touch/selection_bound.cc",
230     "touch/selection_bound.h",
231     "touch/touch_device.h",
232     "touch/touch_editing_controller.cc",
233     "touch/touch_editing_controller.h",
234     "touch/touch_enabled.cc",
235     "touch/touch_enabled.h",
236     "ui_base_export.h",
237     "ui_base_exports.cc",
238     "ui_base_paths.cc",
239     "ui_base_paths.h",
240     "ui_base_switches.cc",
241     "ui_base_switches.h",
242     "ui_base_switches_util.cc",
243     "ui_base_switches_util.h",
244     "ui_base_types.cc",
245     "ui_base_types.h",
246     "user_activity/user_activity_detector.cc",
247     "user_activity/user_activity_detector.h",
248     "user_activity/user_activity_observer.h",
249     "view_prop.cc",
250     "view_prop.h",
251     "webui/jstemplate_builder.cc",
252     "webui/jstemplate_builder.h",
253     "webui/web_ui_util.cc",
254     "webui/web_ui_util.h",
255     "win/accessibility_ids_win.h",
256     "win/accessibility_misc_utils.cc",
257     "win/accessibility_misc_utils.h",
258     "win/atl_module.h",
259     "win/foreground_helper.cc",
260     "win/foreground_helper.h",
261     "win/hidden_window.cc",
262     "win/hidden_window.h",
263     "win/hwnd_subclass.cc",
264     "win/hwnd_subclass.h",
265     "win/internal_constants.cc",
266     "win/internal_constants.h",
267     "win/lock_state.cc",
268     "win/lock_state.h",
269     "win/message_box_win.cc",
270     "win/message_box_win.h",
271     "win/mouse_wheel_util.cc",
272     "win/mouse_wheel_util.h",
273     "win/open_file_name_win.cc",
274     "win/open_file_name_win.h",
275     "win/scoped_ole_initializer.cc",
276     "win/scoped_ole_initializer.h",
277     "win/shell.cc",
278     "win/shell.h",
279     "win/touch_input.cc",
280     "win/touch_input.h",
281     "win/window_event_target.cc",
282     "win/window_event_target.h",
283     "window_open_disposition.cc",
284     "window_open_disposition.h",
285     "work_area_watcher_observer.h",
286   ]
288   if (is_win) {
289     sources += [ "touch/touch_device_win.cc" ]
290   } else if (is_android) {
291     sources += [ "touch/touch_device_android.cc" ]
292   } else if (is_ios) {
293     sources += [ "touch/touch_device_ios.cc" ]
294   } else if (is_linux) {
295     sources += [ "touch/touch_device_linux.cc" ]
296   } else {
297     # Empty implementation for all other cases.
298     sources += [ "touch/touch_device.cc" ]
299   }
301   # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
302   configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
304   defines = [ "UI_BASE_IMPLEMENTATION" ]
306   public_deps = [
307     "//base",
308     "//skia",
309     "//ui/events/platform",
310     "//ui/events:events_base",
311     "//ui/gfx",
312     "//ui/gfx/geometry",
313   ]
314   deps = [
315     "//base/third_party/dynamic_annotations",
316     "//base:base_static",
317     "//base:i18n",
318     "//net",
319     "//third_party/icu",
320     "//ui/events",
321     "//ui/events/devices",
322     "//ui/resources",
323     "//ui/strings",
324     "//url",
325   ]
327   if (is_ios) {
328     sources += [
329       "l10n/l10n_util_mac.h",
330       "l10n/l10n_util_mac.mm",
331     ]
332   }
334   if (toolkit_views) {
335     deps += [ "//ui/events" ]
336   }
338   if (use_x11 && use_aura) {
339     sources += [
340       "x/selection_owner.cc",
341       "x/selection_owner.h",
342       "x/selection_requestor.cc",
343       "x/selection_requestor.h",
344       "x/selection_utils.cc",
345       "x/selection_utils.h",
346     ]
347   }
349   if (use_aura) {
350     deps += [ "//ui/events" ]
351   } else {
352     sources -= [
353       "cursor/cursor.cc",
354       "cursor/cursor.h",
355       "dragdrop/drag_utils_aura.cc",
356     ]
357   }
358   if (use_x11) {
359     sources += [
360       "x/x11_foreign_window_manager.cc",
361       "x/x11_foreign_window_manager.h",
362       "x/x11_menu_list.cc",
363       "x/x11_menu_list.h",
364       "x/x11_util.cc",
365       "x/x11_util.h",
366       "x/x11_util_internal.h",
367     ]
368     if (!is_chromeos) {
369       sources += [
370         "idle/idle_query_x11.cc",
371         "idle/idle_query_x11.h",
372         "idle/screensaver_window_finder_x11.cc",
373         "idle/screensaver_window_finder_x11.h",
374       ]
375       configs += [ "//build/config/linux:xscrnsaver" ]
376     }
377     deps += [ "//ui/gfx/x" ]
378   }
380   if (!use_aura || !is_linux) {
381     sources -= [ "resource/resource_bundle_auralinux.cc" ]
382   }
384   if (use_aura && is_win) {
385     sources -= [ "dragdrop/drag_utils_aura.cc" ]
386   }
388   if (is_linux) {
389     configs += [
390       "//build/config/linux:fontconfig",
391       "//build/config/linux:glib",
392     ]
393   }
395   if ((is_linux && !is_chromeos) || is_chromeos) {
396     if (!toolkit_views && !use_aura) {
397       sources -= [
398         "dragdrop/drag_utils.cc",
399         "dragdrop/drag_utils.h",
400       ]
401     }
402   }
404   if (is_chromeos) {
405     deps += [ "//chromeos" ]
406     sources -= [ "idle/idle_linux.cc" ]
407   }
409   if (is_chromeos || (use_aura && ((is_linux && !use_x11) || is_android))) {
410     sources += [
411       "dragdrop/os_exchange_data_provider_aura.cc",
412       "dragdrop/os_exchange_data_provider_aura.h",
413     ]
414   }
416   libs = []
417   if (is_win) {
418     sources += [
419       "cursor/cursor_loader_win.cc",
420       "cursor/cursor_loader_win.h",
421     ]
422     deps += [ "//third_party/wtl" ]
423     cflags = [ "/wd4324" ]  # Structure was padded due to __declspec(align()), which is
424                             # uninteresting.
426     ldflags = [
427       "/DELAYLOAD:d2d1.dll",
428       "/DELAYLOAD:d3d10_1.dll",
429       "/DELAYLOAD:dwmapi.dll",
430     ]
431     libs += [
432       "d2d1.lib",
433       "d3d10_1.lib",
434       "dwmapi.lib",
435       "d2d1.lib",
436       "dwmapi.lib",
437       "oleacc.lib",
438     ]
439   } else {
440     if (!use_aura) {
441       sources -= [
442         "view_prop.cc",
443         "view_prop.h",
444       ]
445     }
446   }
448   if (is_mac) {
449     deps += [ "//third_party/mozilla" ]
451     sources -= [
452       "cursor/image_cursors.cc",
453       "cursor/image_cursors.h",
454       "dragdrop/drag_utils.cc",
455       "dragdrop/drag_utils.h",
456     ]
458     libs += [
459       "Accelerate.framework",
460       "AudioUnit.framework",
461       "CoreVideo.framework",
462     ]
463   }
465   if (use_x11) {
466     #'all_dependent_settings': {
467     #'ldflags': [
468     #'-L<(PRODUCT_DIR)',
469     #],
470     #},
471     configs += [ "//build/config/linux:x11" ]
472   }
474   if (use_aura) {
475     if (use_x11) {
476       sources += [
477         "cursor/cursor_loader_x11.cc",
478         "cursor/cursor_loader_x11.h",
479         "cursor/cursor_x11.cc",
480       ]
481       if (!is_chromeos) {
482         # These Aura X11 files aren't used on ChromeOS.
483         sources += [
484           "dragdrop/os_exchange_data_provider_aurax11.cc",
485           "dragdrop/os_exchange_data_provider_aurax11.h",
486         ]
487       }
488     }
489     if (is_android) {
490       sources += [ "cursor/cursor_loader_android.cc" ]
491     }
492   }
493   if (use_ozone) {
494     sources += [
495       "cursor/cursor_loader_ozone.cc",
496       "cursor/cursor_loader_ozone.h",
497       "cursor/cursor_ozone.cc",
498       "cursor/ozone/bitmap_cursor_factory_ozone.cc",
499       "cursor/ozone/bitmap_cursor_factory_ozone.h",
500     ]
502     deps += [
503       "//ui/events/ozone:events_ozone_layout",
504       "//ui/ozone:ozone_base",
505     ]
506   }
508   if (!toolkit_views && !use_aura) {
509     sources -= [
510       "dragdrop/drag_drop_types.h",
511       "dragdrop/drop_target_event.cc",
512       "dragdrop/drop_target_event.h",
513       "dragdrop/os_exchange_data.cc",
514       "dragdrop/os_exchange_data.h",
515       "nine_image_painter_factory.cc",
516       "nine_image_painter_factory.h",
517     ]
518   }
520   if (is_android) {
521     deps += [
522       ":ui_base_jni_headers",
523       "//ui/android:ui_java",
524     ]
526     libs += [ "jnigraphics" ]
527   }
529   if (is_android && !use_aura) {
530     sources -= [
531       "cursor/cursor_android.cc",
532       "cursor/image_cursors.cc",
533       "cursor/image_cursors.h",
534       "default_theme_provider.cc",
535       "dragdrop/drag_utils.cc",
536       "dragdrop/drag_utils.h",
537       "l10n/l10n_font_util.cc",
538       "models/button_menu_item_model.cc",
539       "models/dialog_model.cc",
540       "theme_provider.cc",
541       "touch/touch_editing_controller.cc",
542       "ui_base_types.cc",
543     ]
544   }
546   # Aura clipboard.
547   if (use_aura) {
548     if (use_x11) {
549       sources += [ "clipboard/clipboard_aurax11.cc" ]
550     } else if (!is_win && !is_android) {
551       # This file is used for all non-X11, non-Windows, non-Android aura Builds.
552       sources += [ "clipboard/clipboard_aura.cc" ]
553     }
554   }
556   if (is_android || is_ios) {
557     sources -= [
558       "device_form_factor_desktop.cc",
559       "idle/idle.cc",
560       "idle/idle.h",
561     ]
562   }
565 source_set("test_support") {
566   testonly = true
567   sources = [
568     "test/material_design_controller_test_api.cc",
569     "test/material_design_controller_test_api.h",
570     "test/nswindow_fullscreen_notification_waiter.h",
571     "test/nswindow_fullscreen_notification_waiter.mm",
572     "test/scoped_fake_nswindow_focus.h",
573     "test/scoped_fake_nswindow_focus.mm",
574     "test/scoped_fake_nswindow_fullscreen.h",
575     "test/scoped_fake_nswindow_fullscreen.mm",
576     "test/test_clipboard.cc",
577     "test/test_clipboard.h",
578     "test/ui_controls.h",
579     "test/ui_controls_aura.cc",
580     "test/ui_controls_internal_win.cc",
581     "test/ui_controls_internal_win.h",
582     "test/ui_controls_mac.mm",
583     "test/ui_controls_win.cc",
584     "test/windowed_nsnotification_observer.h",
585     "test/windowed_nsnotification_observer.mm",
586   ]
588   public_deps = [
589     ":base",
590   ]
591   deps = [
592     "//base",
593     "//skia",
594     "//testing/gtest",
595     "//ui/events:events_base",
596     "//ui/gfx",
597     "//ui/gfx/geometry",
598   ]
600   if (build_ime) {
601     sources += [
602       "ime/dummy_input_method.cc",
603       "ime/dummy_input_method.h",
604       "ime/dummy_text_input_client.cc",
605       "ime/dummy_text_input_client.h",
606     ]
608     deps += [ "//ui/base/ime" ]
609   }
611   if (!use_aura) {
612     sources -= [ "test/ui_controls_aura.cc" ]
613   } else if (is_win) {
614     sources -= [ "test/ui_controls_win.cc" ]
615   }
618 if (is_android) {
619   generate_jni("ui_base_jni_headers") {
620     sources = [
621       "../android/java/src/org/chromium/ui/base/Clipboard.java",
622       "../android/java/src/org/chromium/ui/base/DeviceFormFactor.java",
623       "../android/java/src/org/chromium/ui/base/LocalizationUtils.java",
624       "../android/java/src/org/chromium/ui/base/ResourceBundle.java",
625       "../android/java/src/org/chromium/ui/base/SelectFileDialog.java",
626       "../android/java/src/org/chromium/ui/base/TouchDevice.java",
627     ]
628     jni_package = "base"
629   }
633 # TODO(GYP): Delete this after we've converted everything to GN.
634 # The _run targets exist only for compatibility w/ GYP.
635 group("ui_base_unittests_run") {
636   testonly = true
637   deps = [
638     ":ui_base_unittests",
639   ]
642 # GYP version: ui/base/ui_base_tests.gyp:ui_base_unittests
643 test("ui_base_unittests") {
644   sources = [
645     "ios/cru_context_menu_controller_unittest.mm",
646     "l10n/l10n_util_mac_unittest.mm",
647     "l10n/l10n_util_unittest.cc",
648     "l10n/l10n_util_win_unittest.cc",
649     "l10n/time_format_unittest.cc",
650     "layout_unittest.cc",
651     "models/tree_node_iterator_unittest.cc",
652     "resource/data_pack_literal.cc",
653     "resource/data_pack_unittest.cc",
654     "resource/material_design/material_design_controller_unittest.cc",
655     "resource/resource_bundle_unittest.cc",
656     "template_expressions_unittest.cc",
657     "test/run_all_unittests.cc",
658     "test/scoped_fake_nswindow_fullscreen_unittest.mm",
659     "test/test_clipboard_unittest.cc",
660     "user_activity/user_activity_detector_unittest.cc",
661   ]
663   data = []
664   data_deps = []
666   if (is_android) {
667     sources -= [ "user_activity/user_activity_detector_unittest.cc" ]
668   }
670   if (is_ios) {
671     # Compile this Mac file on iOS as well.
672     set_sources_assignment_filter([])
673     sources += [ "l10n/l10n_util_mac_unittest.mm" ]
674     set_sources_assignment_filter(sources_assignment_filter)
675   } else {  # !is_ios
676     sources += [
677       "accelerators/accelerator_manager_unittest.cc",
678       "accelerators/menu_label_accelerator_util_linux_unittest.cc",
679       "clipboard/custom_data_helper_unittest.cc",
680       "cocoa/base_view_unittest.mm",
681       "cocoa/cocoa_base_utils_unittest.mm",
682       "cocoa/constrained_window/constrained_window_animation_unittest.mm",
683       "cocoa/controls/blue_label_button_unittest.mm",
684       "cocoa/controls/hover_image_menu_button_unittest.mm",
685       "cocoa/controls/hyperlink_button_cell_unittest.mm",
686       "cocoa/controls/hyperlink_text_view_unittest.mm",
687       "cocoa/focus_tracker_unittest.mm",
688       "cocoa/fullscreen_window_manager_unittest.mm",
689       "cocoa/hover_image_button_unittest.mm",
690       "cocoa/menu_controller_unittest.mm",
691       "cocoa/nsgraphics_context_additions_unittest.mm",
692       "cocoa/nsview_additions_unittest.mm",
693       "cocoa/three_part_image_unittest.mm",
694       "cocoa/tracking_area_unittest.mm",
695       "models/list_model_unittest.cc",
696       "models/list_selection_model_unittest.cc",
697       "models/tree_node_model_unittest.cc",
698       "test/data/resource.h",
699       "text/bytes_formatting_unittest.cc",
700       "touch/selection_bound_unittest.cc",
701       "webui/web_ui_util_unittest.cc",
702     ]
703   }
705   if (build_ime) {
706     sources += [
707       "ime/candidate_window_unittest.cc",
708       "ime/chromeos/character_composer_unittest.cc",
709       "ime/chromeos/composition_text_chromeos_unittest.cc",
710       "ime/input_method_base_unittest.cc",
711       "ime/input_method_chromeos_unittest.cc",
712       "ime/remote_input_method_win_unittest.cc",
713       "ime/win/imm32_manager_unittest.cc",
714       "ime/win/tsf_input_scope_unittest.cc",
715     ]
716     if (is_linux && use_aura && !is_chromeos) {
717       sources += [ "ime/input_method_auralinux_unittest.cc" ]
718     }
719     if (use_x11) {
720       sources += [ "ime/composition_text_util_pango_unittest.cc" ]
721     }
722     if (!use_x11 && is_chromeos) {
723       # These were already removed in the non-chromeos case.
724       sources -= [ "ime/input_method_chromeos_unittest.cc" ]
725     }
726   }
728   # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
729   configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
731   deps = [
732     "//base",
733     "//base/allocator",
734     "//base/test:test_support",
735     "//net",
736     "//skia",
737     "//testing/gmock",
738     "//testing/gtest",
739     "//third_party/icu",
740     "//ui/base",
741     "//ui/base:test_support",
742     "//ui/events:events_base",
743     "//ui/events:test_support",
744     "//ui/gfx:test_support",
745     "//ui/resources",
746     "//ui/resources:ui_test_pak",
747     "//ui/strings",
748     "//url",
749   ]
751   if (is_ios) {
752     # TODO(GYP) lots of iOS-only steps for ui_base_unittests
753   }
755   if (build_ime) {
756     deps += [ "//ui/base/ime" ]
757   }
759   if (is_win) {
760     sources += [
761       "dragdrop/os_exchange_data_win_unittest.cc",
762       "win/hwnd_subclass_unittest.cc",
763       "win/open_file_name_win_unittest.cc",
764     ]
766     ldflags = [
767       "/DELAYLOAD:d2d1.dll",
768       "/DELAYLOAD:d3d10_1.dll",
769     ]
770     libs = [
771       "d2d1.lib",
772       "d3d10_1.lib",
773       "imm32.lib",
774       "oleacc.lib",
775     ]
776   }
778   if (is_win) {
779     sources += [ "view_prop_unittest.cc" ]
780   }
782   if (is_android) {
783     apk_deps = [ "//chrome:resources" ]
784     isolate_file = "ui_base_unittests.isolate"
785   }
787   if (use_pango) {
788     configs += [ "//build/config/linux:pangocairo" ]
789   }
791   if (use_x11) {
792     sources += [ "cursor/cursor_loader_x11_unittest.cc" ]
794     configs += [ "//build/config/linux:x11" ]
796     deps += [
797       "//ui/events/platform/x11",
798       "//ui/gfx/x",
799     ]
801     data_deps += [ "//tools/xdisplaycheck" ]
802   }
804   if (is_mac) {
805     deps += [
806       "//third_party/mozilla",
807       #'ui_base_tests_bundle',  TODO(GYP)
808     ]
809   }
811   if (use_aura || toolkit_views) {
812     sources += [ "dragdrop/os_exchange_data_unittest.cc" ]
814     deps += [
815       "//ui/events",
816       "//ui/events/platform",
817     ]
818   }
820   if (use_x11 && !is_chromeos) {
821     sources += [
822       "dragdrop/os_exchange_data_provider_aurax11_unittest.cc",
823       "x/selection_requestor_unittest.cc",
824     ]
825   }
827   if (is_chromeos) {
828     deps += [
829       "//chromeos",
830       "//ui/events:dom_keycode_converter",
831     ]
832   }
834   if (is_linux || is_mac || is_win) {
835     # TODO(brettw): We should be able to depend on //ui/resources:ui_test_pak
836     # instead of depending directly on the non-test .pak files, but depending
837     # on ui_test_pak seems to have no effect.
838     data += [
839       "test/data/data_pack_unittest/truncated-header.pak",
840       "$root_out_dir/ui_test.pak",  # TODO(brettw): remove this line.
841     ]
842     data_deps += [
843       "//ui/resources:ui_test_pak",  # TODO(brettw): this does nothing.
844       "//third_party/mesa:osmesa",
845     ]
846   }
847   if (is_linux || is_win) {
848     data += [
849       # TODO(brettw): Remove these two lines.
850       "$root_out_dir/ui/en-US.pak",
851       "$root_gen_dir/ui/resources/ui_resources_100_percent.pak",
852     ]
853   }
854   if (is_mac) {
855     data += [ "$root_out_dir/ui_unittests Framework.framework/" ]
857     if (is_asan && symbol_level == 0) {
858       data += [ "$root_out_dir/ui_base_unittests.dSYM/" ]
859     }
860   }
862 # TODO(GYP) Mac (ui_base_tests_bundle)