chromium/components/exo/BUILD.gn

# Copyright 2015 The Chromium Authors
# 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/chromeos/ui_mode.gni")
import("//build/config/linux/pkg_config.gni")
import("//build/config/ui.gni")
import("//chrome/common/features.gni")
import("//testing/test.gni")
import("//ui/base/ui_features.gni")

assert(use_ozone)
assert(is_chromeos_ash)

if (use_xkbcommon) {
  pkg_config("xkbcommon") {
    packages = [ "xkbcommon" ]
  }
}

static_library("exo") {
  sources = [
    "buffer.cc",
    "buffer.h",
    "client_controlled_accelerators.cc",
    "client_controlled_accelerators.h",
    "client_controlled_shell_surface.cc",
    "client_controlled_shell_surface.h",
    "custom_window_state_delegate.cc",
    "custom_window_state_delegate.h",
    "data_device.cc",
    "data_device.h",
    "data_device_delegate.h",
    "data_exchange_delegate.h",
    "data_offer.cc",
    "data_offer.h",
    "data_offer_delegate.h",
    "data_offer_observer.h",
    "data_source.cc",
    "data_source.h",
    "data_source_delegate.h",
    "data_source_observer.h",
    "display.cc",
    "display.h",
    "drag_drop_operation.cc",
    "drag_drop_operation.h",
    "extended_drag_offer.cc",
    "extended_drag_offer.h",
    "extended_drag_source.cc",
    "extended_drag_source.h",
    "frame_sink_resource_manager.cc",
    "frame_sink_resource_manager.h",
    "frame_timing_history.cc",
    "frame_timing_history.h",
    "gamepad.cc",
    "gamepad.h",
    "gamepad_observer.h",
    "gaming_seat.cc",
    "gaming_seat.h",
    "input_method_surface.cc",
    "input_method_surface.h",
    "input_method_surface_manager.h",
    "input_trace.h",
    "key_state.h",
    "keyboard.cc",
    "keyboard.h",
    "keyboard_delegate.h",
    "keyboard_device_configuration_delegate.h",
    "keyboard_modifiers.h",
    "keyboard_observer.h",
    "layer_tree_frame_sink_holder.cc",
    "layer_tree_frame_sink_holder.h",
    "mime_utils.cc",
    "mime_utils.h",
    "notification.cc",
    "notification.h",
    "notification_surface.cc",
    "notification_surface.h",
    "notification_surface_manager.h",
    "permission.cc",
    "permission.h",
    "pointer.cc",
    "pointer.h",
    "pointer_constraint_delegate.h",
    "pointer_delegate.h",
    "protected_native_pixmap_query_delegate.h",
    "seat.cc",
    "seat.h",
    "seat_observer.h",
    "security_delegate.h",
    "shared_memory.cc",
    "shared_memory.h",
    "shell_surface.cc",
    "shell_surface.h",
    "shell_surface_base.cc",
    "shell_surface_base.h",
    "shell_surface_observer.h",
    "shell_surface_presentation_time_recorder.cc",
    "shell_surface_presentation_time_recorder.h",
    "shell_surface_util.cc",
    "shell_surface_util.h",
    "sub_surface.cc",
    "sub_surface.h",
    "sub_surface_observer.h",
    "surface.cc",
    "surface.h",
    "surface_delegate.h",
    "surface_observer.h",
    "surface_tree_host.cc",
    "surface_tree_host.h",
    "text_input.cc",
    "text_input.h",
    "toast_surface.cc",
    "toast_surface.h",
    "toast_surface_manager.h",
    "touch.cc",
    "touch.h",
    "touch_delegate.h",
    "ui_lock_controller.cc",
    "ui_lock_controller.h",
    "vsync_timing_manager.cc",
    "vsync_timing_manager.h",
    "window_properties.cc",
    "window_properties.h",
    "wm_helper.cc",
    "wm_helper.h",
    "xdg_shell_surface.cc",
    "xdg_shell_surface.h",
    "xkb_tracker.cc",
    "xkb_tracker.h",
  ]

  deps = [
    "//ash",
    "//ash/constants",
    "//ash/keyboard/ui",
    "//ash/public/cpp",
    "//ash/resources/vector_icons",
    "//base",
    "//cc",
    "//cc/mojo_embedder:mojo_embedder",
    "//chromeos/crosapi/cpp:crosapi_constants",
    "//chromeos/dbus/power",
    "//chromeos/dbus/power:power_manager_proto",
    "//chromeos/ui/base",
    "//chromeos/ui/frame",
    "//components/account_id",
    "//components/app_restore",
    "//components/fullscreen_control",
    "//components/strings",
    "//components/viz/host",
    "//device/gamepad",
    "//device/gamepad/public/cpp:shared_with_blink",
    "//gpu",
    "//gpu/command_buffer/client:raster_interface",
    "//net",
    "//services/data_decoder/public/cpp",
    "//services/viz/privileged/mojom/compositing",
    "//skia",
    "//third_party/blink/public/common",
    "//ui/accessibility",
    "//ui/accessibility:ax_base",
    "//ui/aura",
    "//ui/base",
    "//ui/base:hit_test",
    "//ui/base/dragdrop:types",
    "//ui/base/dragdrop/mojom",
    "//ui/base/ime",
    "//ui/base/ime/ash",
    "//ui/compositor",
    "//ui/compositor_extra",
    "//ui/display/manager",
    "//ui/events/devices:devices",
    "//ui/events/ozone",
    "//ui/events/ozone/evdev:mouse_button_property",
    "//ui/events/ozone/layout",
    "//ui/gfx",
    "//ui/gfx/geometry",
    "//ui/gl",
    "//ui/message_center",
    "//ui/message_center/public/cpp",
    "//ui/ozone",
    "//ui/views",
    "//ui/wm",
    "//ui/wm/public",
  ]

  assert_no_deps = [
    "//ash/components/arc",
    "//components/arc",
    "//content/public/browser",
    "//content/public/common",
  ]

  public_deps = [
    "//ui/base/cursor",
    "//ui/base/cursor/mojom:cursor_type",
    "//ui/base/dragdrop/mojom:mojom_headers",
  ]

  if (use_xkbcommon) {
    configs += [ ":xkbcommon" ]
  }
}

source_set("test_support") {
  testonly = true

  sources = [
    "mock_vsync_timing_observer.cc",
    "mock_vsync_timing_observer.h",
    "test/exo_test_base.cc",
    "test/exo_test_base.h",
    "test/exo_test_data_exchange_delegate.cc",
    "test/exo_test_data_exchange_delegate.h",
    "test/exo_test_helper.cc",
    "test/exo_test_helper.h",
    "test/exo_test_suite_aura.cc",
    "test/exo_test_suite_aura.h",
    "test/mock_security_delegate.cc",
    "test/mock_security_delegate.h",
    "test/shell_surface_builder.cc",
    "test/shell_surface_builder.h",
    "test/surface_tree_host_test_util.cc",
    "test/surface_tree_host_test_util.h",
    "test/test_data_device_delegate.cc",
    "test/test_data_device_delegate.h",
    "test/test_data_offer_delegate.cc",
    "test/test_data_offer_delegate.h",
    "test/test_data_source_delegate.cc",
    "test/test_data_source_delegate.h",
    "test/test_security_delegate.cc",
    "test/test_security_delegate.h",
  ]

  public_deps = [ "//testing/gtest" ]

  deps = [
    ":exo",
    "//ash:test_support",
    "//ash/public/cpp",
    "//base",
    "//base/test:test_support",
    "//chromeos/ui/base",
    "//components/exo/wayland:test_controller_stub",
    "//components/exo/wayland:ui_controls_protocol_stub",
    "//components/viz/service",
    "//gpu",
    "//skia",
    "//ui/aura",
    "//ui/base/dragdrop/mojom",
    "//ui/base/ime/init",
    "//ui/compositor",
    "//ui/compositor:test_support",
    "//ui/display/manager",
    "//ui/gfx/geometry",
    "//ui/gl:test_support",
    "//ui/views",
    "//ui/views:test_support",
    "//ui/wm",
  ]
}

source_set("unit_tests") {
  testonly = true

  sources = [
    "../../ui/events/ozone/gamepad/gamepad_event.cc",
    "buffer_unittest.cc",
    "client_controlled_shell_surface_unittest.cc",
    "data_device_unittest.cc",
    "data_offer_unittest.cc",
    "data_source_unittest.cc",
    "display_unittest.cc",
    "drag_drop_operation_unittest.cc",
    "event_latency_metrics_unittest.cc",
    "extended_drag_source_unittest.cc",
    "gamepad_unittest.cc",
    "gaming_seat_unittest.cc",
    "input_method_surface_unittest.cc",
    "keyboard_unittest.cc",
    "mime_utils_unittest.cc",
    "notification_unittest.cc",
    "permission_unittest.cc",
    "pointer_unittest.cc",
    "seat_unittest.cc",
    "shared_memory_unittest.cc",
    "shell_surface_presentation_time_recorder_unittest.cc",
    "shell_surface_unittest.cc",
    "shell_surface_util_unittest.cc",
    "sub_surface_unittest.cc",
    "surface_test_util.cc",
    "surface_test_util.h",
    "surface_tree_host_unittest.cc",
    "surface_unittest.cc",
    "text_input_unittest.cc",
    "toast_surface_unittest.cc",
    "touch_unittest.cc",
    "ui_lock_controller_unittest.cc",
    "wm_helper_unittest.cc",
    "xdg_shell_surface_unittest.cc",
  ]

  deps = [
    ":exo",
    ":test_support",
    "//ash",
    "//ash:test_support",
    "//ash/constants",
    "//ash/keyboard/ui",
    "//ash/public/cpp",
    "//ash/public/cpp/external_arc",
    "//base",
    "//base/test:test_support",
    "//cc",
    "//cc:test_support",
    "//cc/mojo_embedder:mojo_embedder",
    "//chromeos/ash/components/login/auth",
    "//chromeos/dbus/power",
    "//chromeos/dbus/power:power_manager_proto",
    "//chromeos/ui/base",
    "//chromeos/ui/frame",
    "//chromeos/ui/wm",
    "//components/fullscreen_control",
    "//components/user_manager",
    "//components/viz/service",
    "//components/viz/test:test_support",
    "//device/gamepad:test_helpers",
    "//gpu/command_buffer/client:raster_interface",
    "//skia",
    "//testing/gmock",
    "//testing/gtest",
    "//ui/aura",
    "//ui/aura:test_support",
    "//ui/base:test_support",
    "//ui/base/cursor/mojom:cursor_type",
    "//ui/base/dragdrop:types",
    "//ui/base/dragdrop/mojom",
    "//ui/base/ime/ash",
    "//ui/compositor:test_support",
    "//ui/compositor_extra",
    "//ui/events:dom_keycode_converter",
    "//ui/events:test_support",
    "//ui/events/ozone",
    "//ui/gfx",
    "//ui/gfx:test_support",
    "//ui/gfx/geometry",
    "//ui/gl:test_support",
    "//ui/message_center",
    "//ui/views",
    "//ui/wm",
  ]
}

test("exo_unittests") {
  use_xvfb = use_xvfb_in_this_config

  sources = [ "test/run_all_unittests.cc" ]

  deps = [
    ":test_support",
    ":unit_tests",
    "//base",
    "//base/test:test_support",
    "//cc:test_support",
    "//chromeos/ash/components:test_support",
    "//components/exo/server:unit_tests",
    "//components/exo/wayland:unit_tests",
    "//components/viz/test:test_support",
    "//device/gamepad:test_helpers",
    "//mojo/core/embedder",
    "//testing/gtest",
    "//ui/aura",
    "//ui/aura:test_support",
    "//ui/base",
    "//ui/compositor:test_support",
    "//ui/gl:test_support",
  ]

  data_deps = []
}