Fix breakages in https://codereview.chromium.org/1155713003/
[chromium-blink-merge.git] / ui / base / BUILD.gn
blobe6c79d25d21122124cc8c58aca4751d053a156a4
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_plurals.cc",
171     "l10n/l10n_util_plurals.h",
172     "l10n/l10n_util_posix.cc",
173     "l10n/l10n_util_win.cc",
174     "l10n/l10n_util_win.h",
175     "l10n/time_format.cc",
176     "l10n/time_format.h",
177     "layout.cc",
178     "layout.h",
179     "layout_mac.mm",
180     "models/button_menu_item_model.cc",
181     "models/button_menu_item_model.h",
182     "models/combobox_model.cc",
183     "models/combobox_model.h",
184     "models/combobox_model_observer.h",
185     "models/dialog_model.cc",
186     "models/dialog_model.h",
187     "models/list_model.h",
188     "models/list_model_observer.h",
189     "models/list_selection_model.cc",
190     "models/list_selection_model.h",
191     "models/menu_model.cc",
192     "models/menu_model.h",
193     "models/menu_model_delegate.h",
194     "models/menu_separator_types.h",
195     "models/simple_combobox_model.cc",
196     "models/simple_combobox_model.h",
197     "models/simple_menu_model.cc",
198     "models/simple_menu_model.h",
199     "models/table_model.cc",
200     "models/table_model.h",
201     "models/table_model_observer.h",
202     "models/tree_model.cc",
203     "models/tree_model.h",
204     "models/tree_node_iterator.h",
205     "models/tree_node_model.h",
206     "nine_image_painter_factory.cc",
207     "nine_image_painter_factory.h",
208     "page_transition_types.cc",
209     "page_transition_types.h",
210     "resource/data_pack.cc",
211     "resource/data_pack.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     "text/bytes_formatting.cc",
224     "text/bytes_formatting.h",
225     "theme_provider.cc",
226     "theme_provider.h",
227     "touch/selection_bound.cc",
228     "touch/selection_bound.h",
229     "touch/touch_device.h",
230     "touch/touch_editing_controller.cc",
231     "touch/touch_editing_controller.h",
232     "touch/touch_enabled.cc",
233     "touch/touch_enabled.h",
234     "ui_base_export.h",
235     "ui_base_exports.cc",
236     "ui_base_paths.cc",
237     "ui_base_paths.h",
238     "ui_base_switches.cc",
239     "ui_base_switches.h",
240     "ui_base_switches_util.cc",
241     "ui_base_switches_util.h",
242     "ui_base_types.cc",
243     "ui_base_types.h",
244     "user_activity/user_activity_detector.cc",
245     "user_activity/user_activity_detector.h",
246     "user_activity/user_activity_observer.h",
247     "view_prop.cc",
248     "view_prop.h",
249     "webui/jstemplate_builder.cc",
250     "webui/jstemplate_builder.h",
251     "webui/web_ui_util.cc",
252     "webui/web_ui_util.h",
253     "win/accessibility_ids_win.h",
254     "win/accessibility_misc_utils.cc",
255     "win/accessibility_misc_utils.h",
256     "win/atl_module.h",
257     "win/foreground_helper.cc",
258     "win/foreground_helper.h",
259     "win/hidden_window.cc",
260     "win/hidden_window.h",
261     "win/hwnd_subclass.cc",
262     "win/hwnd_subclass.h",
263     "win/internal_constants.cc",
264     "win/internal_constants.h",
265     "win/lock_state.cc",
266     "win/lock_state.h",
267     "win/message_box_win.cc",
268     "win/message_box_win.h",
269     "win/mouse_wheel_util.cc",
270     "win/mouse_wheel_util.h",
271     "win/open_file_name_win.cc",
272     "win/open_file_name_win.h",
273     "win/scoped_ole_initializer.cc",
274     "win/scoped_ole_initializer.h",
275     "win/shell.cc",
276     "win/shell.h",
277     "win/touch_input.cc",
278     "win/touch_input.h",
279     "win/window_event_target.cc",
280     "win/window_event_target.h",
281     "window_open_disposition.cc",
282     "window_open_disposition.h",
283     "work_area_watcher_observer.h",
284   ]
286   if (is_win) {
287     sources += [ "touch/touch_device_win.cc" ]
288   } else if (is_android) {
289     sources += [ "touch/touch_device_android.cc" ]
290   } else if (is_linux) {
291     sources += [ "touch/touch_device_linux.cc" ]
292   } else {
293     # Empty implementation for all other cases.
294     sources += [ "touch/touch_device.cc" ]
295   }
297   # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
298   configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
300   defines = [ "UI_BASE_IMPLEMENTATION" ]
302   public_deps = [
303     "//base",
304     "//skia",
305     "//ui/events/platform",
306     "//ui/events:events_base",
307     "//ui/gfx",
308     "//ui/gfx/geometry",
309   ]
310   deps = [
311     "//base/third_party/dynamic_annotations",
312     "//base:base_static",
313     "//base:i18n",
314     "//net",
315     "//third_party/icu",
316     "//ui/events",
317     "//ui/events/devices",
318     "//ui/resources",
319     "//ui/strings",
320     "//url",
321   ]
323   if (is_ios) {
324     sources += [
325       "l10n/l10n_util_mac.h",
326       "l10n/l10n_util_mac.mm",
327     ]
328   }
330   if (toolkit_views) {
331     deps += [ "//ui/events" ]
332   }
334   if (use_x11 && use_aura) {
335     sources += [
336       "x/selection_owner.cc",
337       "x/selection_owner.h",
338       "x/selection_requestor.cc",
339       "x/selection_requestor.h",
340       "x/selection_utils.cc",
341       "x/selection_utils.h",
342     ]
343   }
345   if (use_aura) {
346     deps += [ "//ui/events" ]
347   } else {
348     sources -= [
349       "cursor/cursor.cc",
350       "cursor/cursor.h",
351       "dragdrop/drag_utils_aura.cc",
352     ]
353   }
354   if (use_x11) {
355     sources += [
356       "x/x11_foreign_window_manager.cc",
357       "x/x11_foreign_window_manager.h",
358       "x/x11_menu_list.cc",
359       "x/x11_menu_list.h",
360       "x/x11_util.cc",
361       "x/x11_util.h",
362       "x/x11_util_internal.h",
363     ]
364     if (!is_chromeos) {
365       sources += [
366         "idle/idle_query_x11.cc",
367         "idle/idle_query_x11.h",
368         "idle/screensaver_window_finder_x11.cc",
369         "idle/screensaver_window_finder_x11.h",
370       ]
371       configs += [ "//build/config/linux:xscrnsaver" ]
372     }
373     deps += [ "//ui/gfx/x" ]
374   }
376   if (!use_aura || !is_linux) {
377     sources -= [ "resource/resource_bundle_auralinux.cc" ]
378   }
380   if (use_aura && is_win) {
381     sources -= [ "dragdrop/drag_utils_aura.cc" ]
382   }
384   if (is_linux) {
385     configs += [
386       "//build/config/linux:fontconfig",
387       "//build/config/linux:glib",
388     ]
389   }
391   if ((is_linux && !is_chromeos) || is_chromeos) {
392     if (!toolkit_views && !use_aura) {
393       sources -= [
394         "dragdrop/drag_utils.cc",
395         "dragdrop/drag_utils.h",
396       ]
397     }
398   }
400   if (is_chromeos) {
401     deps += [ "//chromeos" ]
402     sources -= [ "idle/idle_linux.cc" ]
403   }
405   if (is_chromeos || (use_aura && is_linux && !use_x11)) {
406     sources += [
407       "dragdrop/os_exchange_data_provider_aura.cc",
408       "dragdrop/os_exchange_data_provider_aura.h",
409     ]
410   }
412   libs = []
413   if (is_win) {
414     sources += [
415       "cursor/cursor_loader_win.cc",
416       "cursor/cursor_loader_win.h",
417     ]
418     deps += [ "//third_party/wtl" ]
419     cflags = [ "/wd4324" ]  # Structure was padded due to __declspec(align()), which is
420                             # uninteresting.
422     ldflags = [
423       "/DELAYLOAD:d2d1.dll",
424       "/DELAYLOAD:d3d10_1.dll",
425       "/DELAYLOAD:dwmapi.dll",
426     ]
427     libs += [
428       "d2d1.lib",
429       "d3d10_1.lib",
430       "dwmapi.lib",
431       "d2d1.lib",
432       "dwmapi.lib",
433       "oleacc.lib",
434     ]
435   } else {
436     if (!use_aura) {
437       sources -= [
438         "view_prop.cc",
439         "view_prop.h",
440       ]
441     }
442   }
444   if (is_mac) {
445     deps += [ "//third_party/mozilla" ]
447     sources -= [
448       "cursor/image_cursors.cc",
449       "cursor/image_cursors.h",
450       "dragdrop/drag_utils.cc",
451       "dragdrop/drag_utils.h",
452     ]
454     libs += [
455       "Accelerate.framework",
456       "AudioUnit.framework",
457       "CoreVideo.framework",
458     ]
459   }
461   if (use_x11) {
462     #'all_dependent_settings': {
463     #'ldflags': [
464     #'-L<(PRODUCT_DIR)',
465     #],
466     #},
467     configs += [ "//build/config/linux:x11" ]
468   }
470   if (use_aura) {
471     if (use_x11) {
472       sources += [
473         "cursor/cursor_loader_x11.cc",
474         "cursor/cursor_loader_x11.h",
475         "cursor/cursor_x11.cc",
476       ]
477       if (!is_chromeos) {
478         # These Aura X11 files aren't used on ChromeOS.
479         sources += [
480           "dragdrop/os_exchange_data_provider_aurax11.cc",
481           "dragdrop/os_exchange_data_provider_aurax11.h",
482         ]
483       }
484     }
485   }
486   if (use_ozone) {
487     sources += [
488       "cursor/cursor_loader_ozone.cc",
489       "cursor/cursor_loader_ozone.h",
490       "cursor/cursor_ozone.cc",
491       "cursor/ozone/bitmap_cursor_factory_ozone.cc",
492       "cursor/ozone/bitmap_cursor_factory_ozone.h",
493     ]
495     deps += [
496       "//ui/events/ozone:events_ozone_layout",
497       "//ui/ozone:ozone_base",
498     ]
499   }
501   if (!toolkit_views) {
502     sources -= [
503       "dragdrop/drag_drop_types.h",
504       "dragdrop/drop_target_event.cc",
505       "dragdrop/drop_target_event.h",
506     ]
507   }
509   if (!toolkit_views && !use_aura) {
510     sources -= [
511       "dragdrop/os_exchange_data.cc",
512       "dragdrop/os_exchange_data.h",
513       "nine_image_painter_factory.cc",
514       "nine_image_painter_factory.h",
515     ]
516   }
518   if (is_android) {
519     sources -= [
520       "cursor/image_cursors.cc",
521       "cursor/image_cursors.h",
522       "default_theme_provider.cc",
523       "dragdrop/drag_utils.cc",
524       "dragdrop/drag_utils.h",
525       "l10n/l10n_font_util.cc",
526       "models/button_menu_item_model.cc",
527       "models/dialog_model.cc",
528       "theme_provider.cc",
529       "touch/touch_editing_controller.cc",
530       "ui_base_types.cc",
531     ]
533     deps += [
534       "//cc",
535       ":ui_base_jni_headers",
536       "//ui/android:ui_java",
537     ]
539     libs += [ "jnigraphics" ]
540   }
542   if (is_android && !use_aura) {
543     sources -= [ "cursor/cursor_android.cc" ]
544   }
546   # Aura clipboard.
547   if (use_aura) {
548     if (use_x11) {
549       sources += [ "clipboard/clipboard_aurax11.cc" ]
550     } else if (!is_win) {
551       # This file is used for all non-X11, non-Windows 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/nswindow_fullscreen_notification_waiter.h",
569     "test/nswindow_fullscreen_notification_waiter.mm",
570     "test/test_clipboard.cc",
571     "test/test_clipboard.h",
572     "test/ui_controls.h",
573     "test/ui_controls_aura.cc",
574     "test/ui_controls_internal_win.cc",
575     "test/ui_controls_internal_win.h",
576     "test/ui_controls_mac.mm",
577     "test/ui_controls_win.cc",
578   ]
580   public_deps = [
581     ":base",
582   ]
583   deps = [
584     "//base",
585     "//skia",
586     "//testing/gtest",
587     "//ui/events:events_base",
588     "//ui/gfx",
589     "//ui/gfx/geometry",
590   ]
592   if (build_ime) {
593     sources += [
594       "ime/dummy_input_method.cc",
595       "ime/dummy_input_method.h",
596       "ime/dummy_text_input_client.cc",
597       "ime/dummy_text_input_client.h",
598     ]
600     deps += [ "//ui/base/ime" ]
601   }
603   if (!use_aura) {
604     sources -= [ "test/ui_controls_aura.cc" ]
605   } else if (is_win) {
606     sources -= [ "test/ui_controls_win.cc" ]
607   }
610 if (is_android) {
611   generate_jni("ui_base_jni_headers") {
612     sources = [
613       "../android/java/src/org/chromium/ui/base/Clipboard.java",
614       "../android/java/src/org/chromium/ui/base/DeviceFormFactor.java",
615       "../android/java/src/org/chromium/ui/base/LocalizationUtils.java",
616       "../android/java/src/org/chromium/ui/base/ResourceBundle.java",
617       "../android/java/src/org/chromium/ui/base/SelectFileDialog.java",
618       "../android/java/src/org/chromium/ui/base/TouchDevice.java",
619     ]
620     jni_package = "base"
621   }
624 # GYP version: ui/base/ui_base_tests.gyp:ui_base_unittests
625 test("ui_base_unittests") {
626   sources = [
627     "ios/cru_context_menu_controller_unittest.mm",
628     "l10n/l10n_util_mac_unittest.mm",
629     "l10n/l10n_util_unittest.cc",
630     "l10n/l10n_util_win_unittest.cc",
631     "l10n/time_format_unittest.cc",
632     "layout_unittest.cc",
633     "models/tree_node_iterator_unittest.cc",
634     "resource/data_pack_literal.cc",
635     "resource/data_pack_unittest.cc",
636     "resource/resource_bundle_unittest.cc",
637     "test/run_all_unittests.cc",
638     "test/test_clipboard_unittest.cc",
639     "user_activity/user_activity_detector_unittest.cc",
640   ]
642   if (is_android) {
643     sources -= [ "user_activity/user_activity_detector_unittest.cc" ]
644   }
646   if (is_ios) {
647     # Compile this Mac file on iOS as well.
648     set_sources_assignment_filter([])
649     sources += [ "l10n/l10n_util_mac_unittest.mm" ]
650     set_sources_assignment_filter(sources_assignment_filter)
651   } else {  # !is_ios
652     sources += [
653       "accelerators/accelerator_manager_unittest.cc",
654       "accelerators/menu_label_accelerator_util_linux_unittest.cc",
655       "clipboard/custom_data_helper_unittest.cc",
656       "cocoa/base_view_unittest.mm",
657       "cocoa/cocoa_base_utils_unittest.mm",
658       "cocoa/constrained_window/constrained_window_animation_unittest.mm",
659       "cocoa/controls/blue_label_button_unittest.mm",
660       "cocoa/controls/hover_image_menu_button_unittest.mm",
661       "cocoa/controls/hyperlink_button_cell_unittest.mm",
662       "cocoa/controls/hyperlink_text_view_unittest.mm",
663       "cocoa/focus_tracker_unittest.mm",
664       "cocoa/fullscreen_window_manager_unittest.mm",
665       "cocoa/hover_image_button_unittest.mm",
666       "cocoa/menu_controller_unittest.mm",
667       "cocoa/nsgraphics_context_additions_unittest.mm",
668       "cocoa/nsview_additions_unittest.mm",
669       "cocoa/three_part_image_unittest.mm",
670       "cocoa/tracking_area_unittest.mm",
671       "models/list_model_unittest.cc",
672       "models/list_selection_model_unittest.cc",
673       "models/tree_node_model_unittest.cc",
674       "test/data/resource.h",
675       "text/bytes_formatting_unittest.cc",
676       "touch/selection_bound_unittest.cc",
677       "view_prop_unittest.cc",
678       "webui/web_ui_util_unittest.cc",
679     ]
680   }
682   if (build_ime) {
683     sources += [
684       "ime/candidate_window_unittest.cc",
685       "ime/chromeos/character_composer_unittest.cc",
686       "ime/chromeos/composition_text_chromeos_unittest.cc",
687       "ime/input_method_base_unittest.cc",
688       "ime/input_method_chromeos_unittest.cc",
689       "ime/remote_input_method_win_unittest.cc",
690       "ime/win/imm32_manager_unittest.cc",
691       "ime/win/tsf_input_scope_unittest.cc",
692     ]
693     if (is_linux && use_aura && !is_chromeos) {
694       sources += [ "ime/input_method_auralinux_unittest.cc" ]
695     }
696     if (use_x11) {
697       sources += [ "ime/composition_text_util_pango_unittest.cc" ]
698     }
699     if (!use_x11 && is_chromeos) {
700       # These were already removed in the non-chromeos case.
701       sources -= [
702         "ime/chromeos/character_composer_unittest.cc",
703         "ime/input_method_chromeos_unittest.cc",
704       ]
705     }
706   }
708   # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
709   configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
711   deps = [
712     "//base",
713     "//base/allocator",
714     "//base/test:test_support",
715     "//net",
716     "//skia",
717     "//testing/gmock",
718     "//testing/gtest",
719     "//third_party/icu",
720     "//ui/base",
721     "//ui/base:test_support",
722     "//ui/events:events_base",
723     "//ui/events:test_support",
724     "//ui/gfx:test_support",
725     "//ui/resources",
726     "//ui/resources:ui_test_pak",
727     "//ui/strings",
728     "//url",
729   ]
731   if (is_ios) {
732     # TODO(GYP) lots of iOS-only steps for ui_base_unittests
733   }
735   if (build_ime) {
736     deps += [ "//ui/base/ime" ]
737   }
739   if (is_win) {
740     sources += [
741       "dragdrop/os_exchange_data_win_unittest.cc",
742       "win/hwnd_subclass_unittest.cc",
743       "win/open_file_name_win_unittest.cc",
744     ]
746     ldflags = [
747       "/DELAYLOAD:d2d1.dll",
748       "/DELAYLOAD:d3d10_1.dll",
749     ]
750     libs = [
751       "d2d1.lib",
752       "d3d10_1.lib",
753       "imm32.lib",
754       "oleacc.lib",
755     ]
756   }
758   if (!is_win || !use_aura) {
759     sources -= [ "view_prop_unittest.cc" ]
760   }
762   if (is_android) {
763     apk_deps = [ "//chrome:resources" ]
764   }
766   if (use_pango) {
767     configs += [ "//build/config/linux:pangocairo" ]
768   }
770   if (use_x11) {
771     sources += [ "cursor/cursor_loader_x11_unittest.cc" ]
773     configs += [ "//build/config/linux:x11" ]
775     deps += [
776       "//ui/events/platform/x11",
777       "//ui/gfx/x",
778     ]
780     datadeps = [
781       "//tools/xdisplaycheck",
782     ]
783   }
785   if (is_mac) {
786     deps += [
787       "//third_party/mozilla",
788       #'ui_base_tests_bundle',  TODO(GYP)
789     ]
790   }
792   if (use_aura || toolkit_views) {
793     sources += [ "dragdrop/os_exchange_data_unittest.cc" ]
795     deps += [
796       "//ui/events",
797       "//ui/events/platform",
798     ]
799   }
801   if (use_x11 && !is_chromeos) {
802     sources += [
803       "dragdrop/os_exchange_data_provider_aurax11_unittest.cc",
804       "x/selection_requestor_unittest.cc",
805     ]
806   }
808   if (is_chromeos) {
809     deps += [
810       "//chromeos",
811       "//ui/events:dom_keycode_converter",
812     ]
813   }
815 # TODO(GYP) Mac (ui_base_tests_bundle)