blob: f56d72e10316fdf5739eb0ad4c6ef5c7b1484cce [file] [log] [blame]
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/buildflag_header.gni")
import("//build/config/compiler/compiler.gni")
import("//build/config/sanitizers/sanitizers.gni")
import("//build/config/ui.gni")
import("//testing/test.gni")
import("//ui/base/ui_features.gni")
import("//ui/ozone/ozone.gni")
if (is_android) {
import("//build/config/android/config.gni")
import("//build/config/android/rules.gni")
} else if (is_mac) {
import("//build/config/mac/rules.gni")
}
build_ime = !is_ios
# As part of building Chrome on iOS, it is necessary to run a tool on
# the host to load datapack and generate output in a format defined
# by the platform (this is to support notifications).
#
# Introduce a standalone target that build on both 'host' and 'target'
# toolset that just build the support to load datapack. The dependency
# should be kept minimal to have to build too many targets with multiple
# toolsets.
component("ui_data_pack") {
sources = [
"resource/data_pack.cc",
"resource/data_pack.h",
"resource/data_pack_export.h",
"resource/resource_handle.h",
"resource/scale_factor.cc",
"resource/scale_factor.h",
]
deps = [
"//base",
]
defines = [ "UI_DATA_PACK_IMPLEMENTATION" ]
# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
}
buildflag_header("ui_features") {
header = "ui_features.h"
flags = [ "ENABLE_HIDPI=$enable_hidpi" ]
}
component("base") {
output_name = "ui_base"
sources = [
"accelerators/menu_label_accelerator_util_linux.cc",
"accelerators/menu_label_accelerator_util_linux.h",
"accelerators/platform_accelerator.h",
"accelerators/platform_accelerator_cocoa.h",
"accelerators/platform_accelerator_cocoa.mm",
"android/ui_base_jni_registrar.cc",
"android/ui_base_jni_registrar.h",
"clipboard/clipboard_android.cc",
"clipboard/clipboard_android.h",
"clipboard/clipboard_mac.h",
"clipboard/clipboard_mac.mm",
"clipboard/clipboard_types.h",
"clipboard/clipboard_util_mac.h",
"clipboard/clipboard_util_mac.mm",
"clipboard/clipboard_util_win.cc",
"clipboard/clipboard_util_win.h",
"clipboard/clipboard_win.cc",
"clipboard/clipboard_win.h",
"clipboard/custom_data_helper_mac.mm",
"cocoa/animation_utils.h",
"cocoa/appkit_utils.h",
"cocoa/appkit_utils.mm",
"cocoa/base_view.h",
"cocoa/base_view.mm",
"cocoa/cocoa_base_utils.h",
"cocoa/cocoa_base_utils.mm",
"cocoa/command_dispatcher.h",
"cocoa/command_dispatcher.mm",
"cocoa/constrained_window/constrained_window_animation.h",
"cocoa/constrained_window/constrained_window_animation.mm",
"cocoa/controls/blue_label_button.h",
"cocoa/controls/blue_label_button.mm",
"cocoa/controls/hover_image_menu_button.h",
"cocoa/controls/hover_image_menu_button.mm",
"cocoa/controls/hover_image_menu_button_cell.h",
"cocoa/controls/hover_image_menu_button_cell.mm",
"cocoa/controls/hyperlink_button_cell.h",
"cocoa/controls/hyperlink_button_cell.mm",
"cocoa/controls/hyperlink_text_view.h",
"cocoa/controls/hyperlink_text_view.mm",
"cocoa/find_pasteboard.h",
"cocoa/find_pasteboard.mm",
"cocoa/flipped_view.h",
"cocoa/flipped_view.mm",
"cocoa/focus_tracker.h",
"cocoa/focus_tracker.mm",
"cocoa/focus_window_set.h",
"cocoa/focus_window_set.mm",
"cocoa/fullscreen_window_manager.h",
"cocoa/fullscreen_window_manager.mm",
"cocoa/hover_button.h",
"cocoa/hover_button.mm",
"cocoa/hover_image_button.h",
"cocoa/hover_image_button.mm",
"cocoa/menu_controller.h",
"cocoa/menu_controller.mm",
"cocoa/nib_loading.h",
"cocoa/nib_loading.mm",
"cocoa/nscolor_additions.h",
"cocoa/nscolor_additions.mm",
"cocoa/nsgraphics_context_additions.h",
"cocoa/nsgraphics_context_additions.mm",
"cocoa/nsview_additions.h",
"cocoa/nsview_additions.mm",
"cocoa/remote_layer_api.h",
"cocoa/remote_layer_api.mm",
"cocoa/scoped_cg_context_smooth_fonts.h",
"cocoa/scoped_cg_context_smooth_fonts.mm",
"cocoa/three_part_image.h",
"cocoa/three_part_image.mm",
"cocoa/tool_tip_base_view.h",
"cocoa/tool_tip_base_view.mm",
"cocoa/tracking_area.h",
"cocoa/tracking_area.mm",
"cocoa/underlay_opengl_hosting_window.h",
"cocoa/underlay_opengl_hosting_window.mm",
"cocoa/user_interface_item_command_handler.h",
"cocoa/view_description.h",
"cocoa/view_description.mm",
"cocoa/window_size_constants.h",
"cocoa/window_size_constants.mm",
"cursor/cursor.cc",
"cursor/cursor.h",
"cursor/cursor_android.cc",
"cursor/cursor_loader.h",
"cursor/cursor_win.cc",
"default_style.h",
"default_theme_provider_mac.mm",
"device_form_factor.h",
"device_form_factor_android.cc",
"device_form_factor_android.h",
"device_form_factor_desktop.cc",
"device_form_factor_ios.mm",
"dragdrop/drag_drop_types.h",
"dragdrop/drag_drop_types_mac.mm",
"dragdrop/drag_drop_types_win.cc",
"dragdrop/drag_source_win.cc",
"dragdrop/drag_source_win.h",
"dragdrop/drag_utils_win.cc",
"dragdrop/drop_target_event.cc",
"dragdrop/drop_target_event.h",
"dragdrop/drop_target_win.cc",
"dragdrop/drop_target_win.h",
"dragdrop/os_exchange_data.cc",
"dragdrop/os_exchange_data.h",
"dragdrop/os_exchange_data_provider_mac.h",
"dragdrop/os_exchange_data_provider_mac.mm",
"dragdrop/os_exchange_data_provider_win.cc",
"dragdrop/os_exchange_data_provider_win.h",
"hit_test.h",
"l10n/formatter.cc",
"l10n/formatter.h",
"l10n/l10n_font_util.cc",
"l10n/l10n_font_util.h",
"l10n/l10n_util.cc",
"l10n/l10n_util.h",
"l10n/l10n_util_android.cc",
"l10n/l10n_util_android.h",
"l10n/l10n_util_collator.h",
"l10n/l10n_util_mac.h",
"l10n/l10n_util_mac.mm",
"l10n/l10n_util_posix.cc",
"l10n/l10n_util_win.cc",
"l10n/l10n_util_win.h",
"l10n/time_format.cc",
"l10n/time_format.h",
"layout.cc",
"layout.h",
"layout_mac.mm",
"material_design/material_design_controller.cc",
"material_design/material_design_controller.h",
"models/button_menu_item_model.cc",
"models/button_menu_item_model.h",
"models/combobox_model.cc",
"models/combobox_model.h",
"models/combobox_model_observer.h",
"models/dialog_model.cc",
"models/dialog_model.h",
"models/list_model.h",
"models/list_model_observer.h",
"models/list_selection_model.cc",
"models/list_selection_model.h",
"models/menu_model.cc",
"models/menu_model.h",
"models/menu_model_delegate.h",
"models/menu_separator_types.h",
"models/simple_combobox_model.cc",
"models/simple_combobox_model.h",
"models/simple_menu_model.cc",
"models/simple_menu_model.h",
"models/table_model.cc",
"models/table_model.h",
"models/table_model_observer.h",
"models/tree_model.cc",
"models/tree_model.h",
"models/tree_node_iterator.h",
"models/tree_node_model.h",
"nine_image_painter_factory.cc",
"nine_image_painter_factory.h",
"page_transition_types.cc",
"page_transition_types.h",
"resource/resource_bundle.cc",
"resource/resource_bundle.h",
"resource/resource_bundle_android.cc",
"resource/resource_bundle_auralinux.cc",
"resource/resource_bundle_ios.mm",
"resource/resource_bundle_mac.mm",
"resource/resource_bundle_win.cc",
"resource/resource_bundle_win.h",
"resource/resource_data_dll_win.cc",
"resource/resource_data_dll_win.h",
"template_expressions.cc",
"template_expressions.h",
"theme_provider.cc",
"theme_provider.h",
"touch/touch_device.h",
"touch/touch_editing_controller.cc",
"touch/touch_editing_controller.h",
"touch/touch_enabled.cc",
"touch/touch_enabled.h",
"ui_base_export.h",
"ui_base_exports.cc",
"ui_base_paths.cc",
"ui_base_paths.h",
"ui_base_switches.cc",
"ui_base_switches.h",
"ui_base_switches_util.cc",
"ui_base_switches_util.h",
"ui_base_types.cc",
"ui_base_types.h",
"user_activity/user_activity_detector.cc",
"user_activity/user_activity_detector.h",
"user_activity/user_activity_observer.h",
"view_prop.cc",
"view_prop.h",
"webui/jstemplate_builder.cc",
"webui/jstemplate_builder.h",
"webui/web_ui_util.cc",
"webui/web_ui_util.h",
"win/accessibility_ids_win.h",
"win/accessibility_misc_utils.cc",
"win/accessibility_misc_utils.h",
"win/atl_module.h",
"win/foreground_helper.cc",
"win/foreground_helper.h",
"win/hidden_window.cc",
"win/hidden_window.h",
"win/hwnd_subclass.cc",
"win/hwnd_subclass.h",
"win/internal_constants.cc",
"win/internal_constants.h",
"win/lock_state.cc",
"win/lock_state.h",
"win/message_box_win.cc",
"win/message_box_win.h",
"win/mouse_wheel_util.cc",
"win/mouse_wheel_util.h",
"win/open_file_name_win.cc",
"win/open_file_name_win.h",
"win/osk_display_manager.cc",
"win/osk_display_manager.h",
"win/osk_display_observer.h",
"win/scoped_ole_initializer.cc",
"win/scoped_ole_initializer.h",
"win/shell.cc",
"win/shell.h",
"win/touch_input.cc",
"win/touch_input.h",
"win/window_event_target.cc",
"win/window_event_target.h",
"window_open_disposition.cc",
"window_open_disposition.h",
"work_area_watcher_observer.h",
]
if (!is_ios) {
sources += [
"accelerators/accelerator.cc",
"accelerators/accelerator.h",
"accelerators/accelerator_history.cc",
"accelerators/accelerator_history.h",
"accelerators/accelerator_manager.cc",
"accelerators/accelerator_manager.h",
"base_window.cc",
"base_window.h",
"clipboard/clipboard.cc",
"clipboard/clipboard.h",
"clipboard/clipboard_constants.cc",
"clipboard/clipboard_monitor.cc",
"clipboard/clipboard_monitor.h",
"clipboard/clipboard_observer.h",
"clipboard/custom_data_helper.cc",
"clipboard/custom_data_helper.h",
"clipboard/scoped_clipboard_writer.cc",
"clipboard/scoped_clipboard_writer.h",
"cursor/cursor_util.cc",
"cursor/cursor_util.h",
"cursor/cursors_aura.cc",
"cursor/cursors_aura.h",
"cursor/image_cursors.cc",
"cursor/image_cursors.h",
"default_theme_provider.cc",
"default_theme_provider.h",
"dragdrop/cocoa_dnd_util.h",
"dragdrop/cocoa_dnd_util.mm",
"dragdrop/drag_utils.cc",
"dragdrop/drag_utils.h",
"dragdrop/file_info.cc",
"dragdrop/file_info.h",
"idle/idle.cc",
"idle/idle.h",
"idle/idle_android.cc",
"idle/idle_chromeos.cc",
"idle/idle_linux.cc",
"idle/idle_mac.mm",
"idle/idle_win.cc",
"text/bytes_formatting.cc",
"text/bytes_formatting.h",
]
}
if (is_win) {
sources += [ "touch/touch_device_win.cc" ]
} else if (is_android) {
sources += [ "touch/touch_device_android.cc" ]
} else if (is_ios) {
sources += [ "touch/touch_device_ios.cc" ]
} else if (is_linux) {
sources += [ "touch/touch_device_linux.cc" ]
} else {
# Empty implementation for all other cases.
sources += [ "touch/touch_device.cc" ]
}
# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
defines = [ "UI_BASE_IMPLEMENTATION" ]
public_deps = [
":ui_features",
"//base",
"//skia",
"//ui/events:events_base",
"//ui/events/platform",
"//ui/gfx",
"//ui/gfx/geometry",
]
deps = [
"//base:base_static",
"//base:i18n",
"//base/third_party/dynamic_annotations",
"//net",
"//third_party/icu",
"//third_party/zlib:zlib",
"//ui/base:ui_data_pack",
"//ui/display",
"//ui/events",
"//ui/events/devices",
"//ui/resources",
"//ui/strings",
"//url",
]
if (is_ios) {
set_sources_assignment_filter([])
sources += [
"l10n/l10n_util_mac.h",
"l10n/l10n_util_mac.mm",
]
set_sources_assignment_filter(sources_assignment_filter)
}
if (toolkit_views) {
deps += [ "//ui/events" ]
}
if (use_x11) {
public_deps += [ "//ui/base/x" ]
configs += [ "//build/config/linux:x11" ]
if (!is_chromeos) {
sources += [
"idle/idle_query_x11.cc",
"idle/idle_query_x11.h",
"idle/screensaver_window_finder_x11.cc",
"idle/screensaver_window_finder_x11.h",
]
configs += [ "//build/config/linux:xscrnsaver" ]
deps += [ "//ui/gfx/x" ]
}
}
if (use_x11 && use_aura) {
sources += [
"cursor/cursor_loader_x11.cc",
"cursor/cursor_loader_x11.h",
"cursor/cursor_x11.cc",
"x/selection_owner.cc",
"x/selection_owner.h",
"x/selection_requestor.cc",
"x/selection_requestor.h",
"x/selection_utils.cc",
"x/selection_utils.h",
]
deps += [
"//ui/events/platform/x11",
"//ui/gfx/x",
]
if (!is_chromeos) {
# These Aura X11 files aren't used on ChromeOS.
sources += [
"dragdrop/os_exchange_data_provider_aurax11.cc",
"dragdrop/os_exchange_data_provider_aurax11.h",
]
}
}
if (use_aura) {
deps += [ "//ui/events" ]
sources += [ "window_tracker_template.h" ]
} else {
sources -= [
"cursor/cursor.cc",
"cursor/cursor.h",
]
}
if (!use_aura || !is_linux) {
sources -= [ "resource/resource_bundle_auralinux.cc" ]
}
if (is_linux) {
deps += [ "//build/linux:fontconfig" ]
}
if (use_glib) {
configs += [ "//build/config/linux:glib" ]
}
if (is_linux) {
if (!toolkit_views && !use_aura) {
sources -= [
"dragdrop/drag_utils.cc",
"dragdrop/drag_utils.h",
]
}
}
if (is_chromeos) {
deps += [ "//chromeos" ]
sources -= [ "idle/idle_linux.cc" ]
}
if (is_chromeos || (use_aura && ((is_linux && !use_x11) || is_android))) {
sources += [
"dragdrop/os_exchange_data_provider_aura.cc",
"dragdrop/os_exchange_data_provider_aura.h",
]
}
libs = []
if (is_win) {
sources += [
"cursor/cursor_loader_win.cc",
"cursor/cursor_loader_win.h",
]
deps += [ "//third_party/wtl" ]
cflags = [ "/wd4324" ] # Structure was padded due to __declspec(align()), which is
# uninteresting.
ldflags = [
"/DELAYLOAD:d2d1.dll",
"/DELAYLOAD:d3d10_1.dll",
"/DELAYLOAD:dwmapi.dll",
]
libs += [
"d2d1.lib",
"d3d10_1.lib",
"dwmapi.lib",
"d2d1.lib",
"dwmapi.lib",
"oleacc.lib",
]
} else {
if (!use_aura) {
sources -= [
"view_prop.cc",
"view_prop.h",
]
}
}
if (is_mac) {
deps += [ "//third_party/mozilla" ]
sources -= [
"cursor/image_cursors.cc",
"cursor/image_cursors.h",
]
libs += [
"Accelerate.framework",
"AppKit.framework",
"AudioUnit.framework",
"Carbon.framework",
"CoreVideo.framework",
"Foundation.framework",
]
}
if (use_aura) {
if (is_android) {
sources += [ "cursor/cursor_loader_android.cc" ]
}
}
if (use_ozone) {
sources += [
"cursor/cursor_loader_ozone.cc",
"cursor/cursor_loader_ozone.h",
"cursor/cursor_ozone.cc",
"cursor/ozone/bitmap_cursor_factory_ozone.cc",
"cursor/ozone/bitmap_cursor_factory_ozone.h",
]
deps += [
"//ui/events/ozone:events_ozone_evdev",
"//ui/events/ozone:events_ozone_layout",
"//ui/ozone:ozone_base",
]
}
if (!toolkit_views && !use_aura) {
sources -= [
"dragdrop/drag_drop_types.h",
"dragdrop/drop_target_event.cc",
"dragdrop/drop_target_event.h",
"dragdrop/os_exchange_data.cc",
"dragdrop/os_exchange_data.h",
"nine_image_painter_factory.cc",
"nine_image_painter_factory.h",
]
}
if (is_android) {
deps += [
":ui_base_jni_headers",
"//ui/android:ui_java",
]
libs += [ "jnigraphics" ]
}
if (is_android && !use_aura) {
sources -= [
"cursor/cursor_android.cc",
"cursor/image_cursors.cc",
"cursor/image_cursors.h",
"default_theme_provider.cc",
"dragdrop/drag_utils.cc",
"dragdrop/drag_utils.h",
"idle/idle.cc",
"idle/idle.h",
"idle/idle_android.cc",
"l10n/l10n_font_util.cc",
"models/button_menu_item_model.cc",
"models/dialog_model.cc",
"theme_provider.cc",
"touch/touch_editing_controller.cc",
"ui_base_types.cc",
]
}
# Aura clipboard.
if (use_aura) {
if (use_clipboard_aurax11) {
sources += [
"clipboard/clipboard_aurax11.cc",
"clipboard/clipboard_aurax11.h",
]
} else if (!is_win && !is_android) {
# This file is used for all non-X11, non-Windows, non-Android aura Builds.
sources += [
"clipboard/clipboard_aura.cc",
"clipboard/clipboard_aura.h",
]
}
}
if (is_android || is_ios) {
sources -= [ "device_form_factor_desktop.cc" ]
}
}
source_set("test_support") {
testonly = true
sources = [
"test/material_design_controller_test_api.cc",
"test/material_design_controller_test_api.h",
"test/ui_controls.h",
"test/ui_controls_aura.cc",
"test/ui_controls_internal_win.cc",
"test/ui_controls_internal_win.h",
"test/ui_controls_mac.mm",
"test/ui_controls_win.cc",
]
if (!is_ios) {
sources += [
"test/nswindow_fullscreen_notification_waiter.h",
"test/nswindow_fullscreen_notification_waiter.mm",
"test/scoped_fake_full_keyboard_access.h",
"test/scoped_fake_full_keyboard_access.mm",
"test/scoped_fake_nswindow_focus.h",
"test/scoped_fake_nswindow_focus.mm",
"test/scoped_fake_nswindow_fullscreen.h",
"test/scoped_fake_nswindow_fullscreen.mm",
"test/scoped_preferred_scroller_style_mac.h",
"test/scoped_preferred_scroller_style_mac.mm",
"test/test_clipboard.cc",
"test/test_clipboard.h",
"test/windowed_nsnotification_observer.h",
"test/windowed_nsnotification_observer.mm",
]
} else {
sources += [
"test/ios/keyboard_appearance_listener.h",
"test/ios/keyboard_appearance_listener.mm",
"test/ios/ui_view_test_utils.h",
"test/ios/ui_view_test_utils.mm",
]
}
public_deps = [
":base",
]
deps = [
"//base",
"//base/test:test_config",
"//skia",
"//testing/gtest",
"//ui/base:ui_data_pack",
"//ui/events:events_base",
"//ui/events:test_support",
"//ui/gfx",
"//ui/gfx/geometry",
]
if (build_ime) {
sources += [
"ime/dummy_input_method.cc",
"ime/dummy_input_method.h",
"ime/dummy_text_input_client.cc",
"ime/dummy_text_input_client.h",
]
deps += [
"//ui/base/ime",
"//ui/events",
]
}
if (!use_aura) {
sources -= [ "test/ui_controls_aura.cc" ]
} else if (is_win) {
sources -= [ "test/ui_controls_win.cc" ]
}
}
if (is_android) {
generate_jni("ui_base_jni_headers") {
sources = [
"../android/java/src/org/chromium/ui/base/Clipboard.java",
"../android/java/src/org/chromium/ui/base/DeviceFormFactor.java",
"../android/java/src/org/chromium/ui/base/LocalizationUtils.java",
"../android/java/src/org/chromium/ui/base/ResourceBundle.java",
"../android/java/src/org/chromium/ui/base/SelectFileDialog.java",
"../android/java/src/org/chromium/ui/base/TouchDevice.java",
]
jni_package = "base"
}
}
bundle_data("ui_base_unittests_bundle_data") {
testonly = true
sources = [
"test/data/data_pack_unittest/truncated-header.pak",
]
outputs = [
"{{bundle_resources_dir}}/" +
"{{source_root_relative_dir}}/{{source_file_part}}",
]
}
# GYP version: ui/base/ui_base_tests.gyp:ui_base_unittests
test("ui_base_unittests") {
sources = [
"clipboard/clipboard_util_mac_unittest.mm",
"l10n/l10n_util_mac_unittest.mm",
"l10n/l10n_util_unittest.cc",
"l10n/l10n_util_win_unittest.cc",
"l10n/time_format_unittest.cc",
"layout_unittest.cc",
"material_design/material_design_controller_unittest.cc",
"models/tree_node_iterator_unittest.cc",
"resource/data_pack_literal.cc",
"resource/data_pack_unittest.cc",
"resource/resource_bundle_unittest.cc",
"resource/scale_factor_unittest.cc",
"template_expressions_unittest.cc",
"test/page_transition_types_unittest.cc",
"test/run_all_unittests.cc",
"user_activity/user_activity_detector_unittest.cc",
]
if (!is_ios) {
sources += [
"test/scoped_fake_nswindow_fullscreen_unittest.mm",
"test/test_clipboard_unittest.cc",
]
}
data = []
data_deps = []
if (is_android) {
sources -= [ "user_activity/user_activity_detector_unittest.cc" ]
}
if (is_ios) {
# Compile this Mac file on iOS as well.
set_sources_assignment_filter([])
sources += [ "l10n/l10n_util_mac_unittest.mm" ]
set_sources_assignment_filter(sources_assignment_filter)
} else { # !is_ios
sources += [
"accelerators/accelerator_manager_unittest.cc",
"accelerators/menu_label_accelerator_util_linux_unittest.cc",
"clipboard/custom_data_helper_unittest.cc",
"cocoa/base_view_unittest.mm",
"cocoa/cocoa_base_utils_unittest.mm",
"cocoa/constrained_window/constrained_window_animation_unittest.mm",
"cocoa/controls/blue_label_button_unittest.mm",
"cocoa/controls/hover_image_menu_button_unittest.mm",
"cocoa/controls/hyperlink_button_cell_unittest.mm",
"cocoa/controls/hyperlink_text_view_unittest.mm",
"cocoa/focus_tracker_unittest.mm",
"cocoa/fullscreen_window_manager_unittest.mm",
"cocoa/hover_image_button_unittest.mm",
"cocoa/menu_controller_unittest.mm",
"cocoa/nscolor_additions_unittest.mm",
"cocoa/nsgraphics_context_additions_unittest.mm",
"cocoa/nsview_additions_unittest.mm",
"cocoa/three_part_image_unittest.mm",
"cocoa/tracking_area_unittest.mm",
"models/list_model_unittest.cc",
"models/list_selection_model_unittest.cc",
"models/tree_node_model_unittest.cc",
"test/data/resource.h",
"text/bytes_formatting_unittest.cc",
"webui/web_ui_util_unittest.cc",
]
}
if (build_ime) {
sources += [
"ime/candidate_window_unittest.cc",
"ime/chromeos/character_composer_unittest.cc",
"ime/composition_text_unittest.cc",
"ime/input_method_base_unittest.cc",
"ime/input_method_chromeos_unittest.cc",
"ime/win/imm32_manager_unittest.cc",
"ime/win/tsf_input_scope_unittest.cc",
]
if (is_linux && use_aura && !is_chromeos) {
sources += [ "ime/input_method_auralinux_unittest.cc" ]
}
if (is_mac) {
sources += [ "resource/resource_bundle_mac_unittest.mm" ]
}
if (use_x11) {
sources += [ "ime/composition_text_util_pango_unittest.cc" ]
}
if (!use_x11 && is_chromeos) {
# These were already removed in the non-chromeos case.
sources -= [ "ime/input_method_chromeos_unittest.cc" ]
}
}
# TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
configs += [ "//build/config/compiler:no_size_t_to_int_warning" ]
deps = [
":ui_base_unittests_bundle_data",
"//base",
"//base/test:test_support",
"//net",
"//skia",
"//testing/gmock",
"//testing/gtest",
"//third_party/icu",
"//ui/base",
"//ui/base:test_support",
"//ui/base:ui_data_pack",
"//ui/display",
"//ui/events:events_base",
"//ui/events:test_support",
"//ui/gfx:test_support",
"//ui/resources",
"//ui/resources:ui_test_pak",
"//ui/strings",
"//url",
]
if (build_ime) {
deps += [ "//ui/base/ime" ]
}
if (is_ios) {
deps += [ "//ui/resources:ui_test_pak_bundle_data" ]
}
if (is_win) {
sources += [
"dragdrop/os_exchange_data_win_unittest.cc",
"win/hwnd_subclass_unittest.cc",
"win/open_file_name_win_unittest.cc",
"win/osk_display_manager_unittest.cc",
]
ldflags = [
"/DELAYLOAD:d2d1.dll",
"/DELAYLOAD:d3d10_1.dll",
]
libs = [
"d2d1.lib",
"d3d10_1.lib",
"imm32.lib",
"oleacc.lib",
]
}
if (is_win) {
sources += [ "view_prop_unittest.cc" ]
}
if (is_android) {
deps += [
"//chrome:resources",
"//ui/android:ui_java",
]
}
if (use_pango) {
configs += [ "//build/config/linux/pangocairo" ]
}
if (use_x11) {
sources += [ "cursor/cursor_loader_x11_unittest.cc" ]
configs += [ "//build/config/linux:x11" ]
deps += [
"//ui/events/platform/x11",
"//ui/gfx/x",
]
data_deps += [ "//tools/xdisplaycheck" ]
}
if (is_mac) {
deps += [
":ui_unittests_framework",
"//third_party/mozilla",
]
}
if (use_aura || toolkit_views) {
sources += [ "dragdrop/os_exchange_data_unittest.cc" ]
deps += [
"//ui/events",
"//ui/events/platform",
]
}
if (use_x11 && !is_chromeos) {
sources += [
"dragdrop/os_exchange_data_provider_aurax11_unittest.cc",
"x/selection_requestor_unittest.cc",
]
}
if (is_chromeos) {
deps += [
"//chromeos",
"//ui/events:dom_keycode_converter",
]
}
if (is_android || is_linux || is_mac || is_win) {
# TODO(brettw): We should be able to depend on //ui/resources:ui_test_pak
# instead of depending directly on the non-test .pak files, but depending
# on ui_test_pak seems to have no effect.
data += [
"test/data/data_pack_unittest/truncated-header.pak",
"$root_out_dir/ui_test.pak", # TODO(brettw): remove this line.
]
data_deps += [
"//ui/resources:ui_test_pak", # TODO(brettw): this does nothing.
"//third_party/mesa:osmesa",
]
}
if (is_linux || is_win) {
data += [
# TODO(brettw): Remove these two lines.
"$root_out_dir/ui/en-US.pak",
"$root_gen_dir/ui/resources/ui_resources_100_percent.pak",
]
}
if (is_mac) {
data += [ "$root_out_dir/ui_unittests Framework.framework/" ]
if (is_asan && symbol_level == 0) {
# TODO(crbug.com/330301): make this conditional on mac_strip_release.
# data += [ "$root_out_dir/ui_base_unittests.dSYM/" ]
}
}
}
if (is_mac) {
mac_framework_bundle("ui_unittests_framework") {
testonly = true
deps = [
"//ui/resources:ui_test_pak_bundle_data",
]
info_plist = "test/framework-Info.plist"
output_name = "ui_unittests Framework"
}
}