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