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