summaryrefslogtreecommitdiff
path: root/chromium/ui/platform_window/x11/BUILD.gn
blob: 9d1b9ee1054eb9738edfecb8d3afc67f82911095 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# 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/config/jumbo.gni")
import("//build/config/ozone.gni")
import("//build/config/ui.gni")
import("//testing/test.gni")

assert(use_x11 || ozone_platform_x11)

jumbo_component("x11") {
  output_name = "x11_window"

  deps = [
    "//base",
    "//build:chromeos_buildflags",
    "//net",
    "//skia",
    "//ui/base",
    "//ui/base:hit_test",
    "//ui/base:wm_role_names",
    "//ui/base/dragdrop:types",
    "//ui/base/dragdrop/mojom",
    "//ui/base/x",
    "//ui/events",
    "//ui/events/devices",
    "//ui/events/devices/x11",
    "//ui/events/platform",
    "//ui/events/platform/x11",
    "//ui/gfx/x",
    "//ui/platform_window",
    "//ui/platform_window/common",
    "//ui/platform_window/wm",
  ]

  defines = [ "X11_WINDOW_IMPLEMENTATION" ]

  sources = [
    "x11_topmost_window_finder.cc",
    "x11_topmost_window_finder.h",
    "x11_window.cc",
    "x11_window.h",
    "x11_window_export.h",
    "x11_window_manager.cc",
    "x11_window_manager.h",
  ]

  if (use_atk) {
    sources += [
      "atk_event_conversion.cc",
      "atk_event_conversion.h",
    ]
    configs += [ "//build/config/linux/atk" ]
    deps += [ "//ui/events/x" ]
  }
}

test("x11_unittests") {
  use_xvfb = true

  sources = [
    "test/device_data_manager_x11_unittest.cc",
    "test/events_x_unittest.cc",
    "test/x11_event_translation_unittest.cc",
    "test/x11_window_unittest.cc",
  ]

  deps = [
    ":x11",
    "//base",
    "//base/test:run_all_unittests",
    "//base/test:test_support",
    "//build:chromeos_buildflags",
    "//skia",
    "//testing/gmock",
    "//testing/gtest",
    "//ui/base",
    "//ui/base:features",
    "//ui/base/x",
    "//ui/base/x:test_support",
    "//ui/events:test_support",
    "//ui/events/platform/x11",
    "//ui/events/x",
    "//ui/gfx:test_support",
    "//ui/gfx/x",
    "//ui/gfx/x:unit_test",
    "//ui/platform_window",
  ]

  if (!is_chromeos && !is_chromeos_ash && !is_chromeos_lacros) {
    sources += [ "test/os_exchange_data_provider_x11_unittest.cc" ]
    deps += [ "//ui/base/clipboard:clipboard_types" ]
  }

  if (use_ozone) {
    deps += [ "//ui/ozone" ]
  }

  configs += [ "//build/config:precompiled_headers" ]

  # Needed for tests.  Please note that if you want to run tests locally,
  # ensure that you start them from your out directory with the xvfb
  # script so that openbox has time to start. Otherwise, the x11_unittests
  # will time out. e.g. -
  #
  # 1) cd out/Debug.
  # 2) ../../testing/xvfb.py ./x11_unittests.
  #
  #TODO(dpranke): move that to appropriate place after test() template is
  # reworked.
  data_deps = [ "//ui/base/x/xwmstartupcheck" ]
}