Supervised user whitelists: Cleanup
[chromium-blink-merge.git] / ui / display / BUILD.gn
blobd3dcaa661911edeb245f77b8a37aed52915d8335
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 component("display") {
9   sources = [
10     "chromeos/apply_content_protection_task.cc",
11     "chromeos/apply_content_protection_task.h",
12     "chromeos/configure_displays_task.cc",
13     "chromeos/configure_displays_task.h",
14     "chromeos/display_configurator.cc",
15     "chromeos/display_configurator.h",
16     "chromeos/display_layout_manager.h",
17     "chromeos/display_util.cc",
18     "chromeos/display_util.h",
19     "chromeos/ozone/display_configurator_ozone.cc",
20     "chromeos/query_content_protection_task.cc",
21     "chromeos/query_content_protection_task.h",
22     "chromeos/update_display_configuration_task.cc",
23     "chromeos/update_display_configuration_task.h",
24     "chromeos/x11/display_configurator_x11.cc",
25     "chromeos/x11/display_mode_x11.cc",
26     "chromeos/x11/display_mode_x11.h",
27     "chromeos/x11/display_snapshot_x11.cc",
28     "chromeos/x11/display_snapshot_x11.h",
29     "chromeos/x11/display_util_x11.cc",
30     "chromeos/x11/display_util_x11.h",
31     "chromeos/x11/native_display_delegate_x11.cc",
32     "chromeos/x11/native_display_delegate_x11.h",
33     "chromeos/x11/native_display_event_dispatcher_x11.cc",
34     "chromeos/x11/native_display_event_dispatcher_x11.h",
35     "display_export.h",
36     "display_switches.cc",
37     "display_switches.h",
38   ]
40   defines = [ "DISPLAY_IMPLEMENTATION" ]
42   deps = [
43     "//base",
44     "//ui/display/util",
45     "//ui/gfx",
46     "//ui/gfx/geometry",
47   ]
49   if (use_x11) {
50     configs += [
51       "//build/config/linux:x11",
52       "//build/config/linux:xext",
53       "//build/config/linux:xi",
54       "//build/config/linux:xrandr",
55     ]
56     deps += [ "//ui/events/platform" ]
57     if (is_chromeos) {
58       sources -= [ "chromeos/ozone/display_configurator_ozone.cc" ]
59     }
60   }
62   if (is_chromeos) {
63     deps += [ "//ui/display/types" ]
64     if (use_x11) {
65       deps += [ "//ui/gfx/x" ]
66     }
67   }
69   if (use_ozone) {
70     deps += [ "//ui/ozone" ]
71     if (is_chromeos) {
72       sources -= [
73         "chromeos/x11/display_configurator_x11.cc",
74         "chromeos/x11/display_mode_x11.cc",
75         "chromeos/x11/display_mode_x11.h",
76         "chromeos/x11/display_snapshot_x11.cc",
77         "chromeos/x11/display_snapshot_x11.h",
78         "chromeos/x11/display_util_x11.cc",
79         "chromeos/x11/display_util_x11.h",
80         "chromeos/x11/native_display_delegate_x11.cc",
81         "chromeos/x11/native_display_delegate_x11.h",
82         "chromeos/x11/native_display_event_dispatcher_x11.cc",
83         "chromeos/x11/native_display_event_dispatcher_x11.h",
84       ]
85     }
86   }
89 component("test_util") {
90   output_name = "display_test_util"
91   sources = [
92     "chromeos/test/test_display_snapshot.cc",
93     "chromeos/test/test_display_snapshot.h",
94   ]
96   defines = [ "DISPLAY_IMPLEMENTATION" ]
98   public_deps = [
99     ":display",
100   ]
101   deps = [
102     "//base",
103     "//ui/gfx",
104     "//ui/gfx/geometry",
105   ]
107   if (is_chromeos) {
108     deps += [ "//ui/display/types" ]
109   }
112 source_set("test_support") {
113   testonly = true
114   sources = [
115     "chromeos/test/action_logger.cc",
116     "chromeos/test/action_logger.h",
117     "chromeos/test/action_logger_util.cc",
118     "chromeos/test/action_logger_util.h",
119     "chromeos/test/test_display_layout_manager.cc",
120     "chromeos/test/test_display_layout_manager.h",
121     "chromeos/test/test_native_display_delegate.cc",
122     "chromeos/test/test_native_display_delegate.h",
123   ]
125   public_deps = [
126     ":display",
127   ]
128   deps = [
129     "//base",
130     "//ui/display/types",
131     "//ui/gfx",
132     "//ui/gfx/geometry",
133   ]
136 test("display_unittests") {
137   sources = [
138     "chromeos/apply_content_protection_task_unittest.cc",
139     "chromeos/configure_displays_task_unittest.cc",
140     "chromeos/display_configurator_unittest.cc",
141     "chromeos/query_content_protection_task_unittest.cc",
142     "chromeos/update_display_configuration_task_unittest.cc",
143     "chromeos/x11/display_util_x11_unittest.cc",
144     "chromeos/x11/native_display_event_dispatcher_x11_unittest.cc",
145     "util/display_util_unittest.cc",
146     "util/edid_parser_unittest.cc",
147   ]
149   deps = [
150     ":test_util",
151     "//base",
152     "//base/test:run_all_unittests",
153     "//testing/gtest",
154     "//ui/display/util",
155     "//ui/gfx/geometry",
156   ]
158   if (is_chromeos) {
159     deps += [
160       ":display",
161       ":test_support",
162       "//base/test:test_support",
163       "//ui/display/types",
164     ]
165   }
167   if (use_ozone && is_chromeos) {
168     sources -= [
169       "chromeos/x11/display_util_x11_unittest.cc",
170       "chromeos/x11/native_display_event_dispatcher_x11_unittest.cc",
171     ]
172   }