Mandoline: Merge Surfaces and Views apps
[chromium-blink-merge.git] / components / view_manager / BUILD.gn
blobf73bbfc64d22a9962ce149fcd0bbfcaae927597c
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")
7 import("//mojo/public/mojo_application.gni")
9 if (is_android) {
10   import("//build/config/android/config.gni")
11   import("//build/config/android/rules.gni")
13   group("view_manager") {
14     deps = [
15       ":lib",
16       ":loader",
17     ]
18   }
20   source_set("loader") {
21     sources = [
22       "android_loader.cc",
23       "android_loader.h",
24     ]
26     deps = [
27       "public/interfaces",
28       "//third_party/mojo/src/mojo/public/cpp/bindings",
29     ]
30   }
31 } else {
32   mojo_native_application("view_manager") {
33     sources = [
34       "main.cc",
35     ]
37     deps = [
38       ":lib",
39       "//base",
40       "//components/view_manager/public/interfaces",
41       "//components/view_manager/surfaces",
42       "//mojo/application/public/cpp",
43       "//mojo/converters/geometry",
44       "//mojo/environment:chromium",
45       "//mojo/platform_handle",
46       "//third_party/mojo/src/mojo/public/cpp/bindings:bindings",
47       "//ui/events",
48       "//ui/events/platform",
49       "//ui/gl",
50     ]
51   }
54 source_set("lib") {
55   sources = [
56     "access_policy.h",
57     "access_policy_delegate.h",
58     "animation_runner.cc",
59     "animation_runner.h",
60     "animation_runner_observer.h",
61     "client_connection.cc",
62     "client_connection.h",
63     "connection_manager.cc",
64     "connection_manager.h",
65     "connection_manager_delegate.h",
66     "default_access_policy.cc",
67     "default_access_policy.h",
68     "display_manager.cc",
69     "display_manager.h",
70     "display_manager_delegate.h",
71     "display_manager_factory.h",
72     "event_dispatcher.cc",
73     "event_dispatcher.h",
74     "focus_controller.cc",
75     "focus_controller.h",
76     "focus_controller_delegate.h",
77     "gesture_manager.cc",
78     "gesture_manager.h",
79     "gesture_manager_delegate.h",
80     "scheduled_animation_group.cc",
81     "scheduled_animation_group.h",
82     "server_view.cc",
83     "server_view.h",
84     "server_view_delegate.h",
85     "server_view_drawn_tracker.cc",
86     "server_view_drawn_tracker.h",
87     "server_view_drawn_tracker_observer.h",
88     "server_view_observer.h",
89     "view_coordinate_conversions.cc",
90     "view_coordinate_conversions.h",
91     "view_locator.cc",
92     "view_locator.h",
93     "view_manager_app.cc",
94     "view_manager_app.h",
95     "view_manager_root_connection.cc",
96     "view_manager_root_connection.h",
97     "view_manager_root_delegate.h",
98     "view_manager_root_impl.cc",
99     "view_manager_root_impl.h",
100     "view_manager_service_impl.cc",
101     "view_manager_service_impl.h",
102     "window_manager_access_policy.cc",
103     "window_manager_access_policy.h",
104   ]
106   public_deps = [
107     "//components/view_manager/public/cpp",
108   ]
110   deps = [
111     "//base",
112     "//cc/surfaces",
113     "//cc/surfaces:surface_id",
114     "//components/view_manager/public/cpp:common",
115     "//components/view_manager/public/interfaces",
116     "//components/view_manager/surfaces",
117     "//mojo/application/public/cpp",
118     "//mojo/common:tracing_impl",
119     "//mojo/converters/geometry",
120     "//mojo/converters/ime",
121     "//mojo/converters/input_events",
122     "//mojo/converters/surfaces",
123     "//third_party/mojo/src/mojo/public/cpp/bindings:callback",
124     "//ui/events",
125     "//ui/events/platform",
126     "//ui/gfx",
127     "//ui/gfx/geometry",
128     "//ui/gl:test_support",
129     "//ui/mojo/events:interfaces",
130     "//ui/mojo/geometry:interfaces",
131     "//ui/platform_window:platform_impls",
132   ]
135 source_set("test_support") {
136   testonly = true
138   sources = [
139     "test_change_tracker.cc",
140     "test_change_tracker.h",
141   ]
143   deps = [
144     "//base",
145     "//components/view_manager/public/cpp",
146     "//components/view_manager/public/cpp:common",
147     "//components/view_manager/public/interfaces",
148     "//mojo/common",
149     "//third_party/mojo/src/mojo/public/cpp/bindings:bindings",
150     "//ui/mojo/geometry:interfaces",
151   ]
154 group("tests") {
155   testonly = true
156   deps = [
157     ":apptests",
158     ":view_manager_unittests",
159     "//components/view_manager/public/cpp/tests:mojo_view_manager_lib_unittests",
160   ]
163 test("view_manager_unittests") {
164   sources = [
165     "animation_runner_unittest.cc",
166     "focus_controller_unittest.cc",
167     "gesture_manager_unittest.cc",
168     "scheduled_animation_group_unittest.cc",
169     "server_view_drawn_tracker_unittest.cc",
170     "test_server_view_delegate.cc",
171     "test_server_view_delegate.h",
172     "view_coordinate_conversions_unittest.cc",
173     "view_manager_service_unittest.cc",
174   ]
176   deps = [
177     ":test_support",
178     ":lib",
179     "//base",
180     "//base/test:test_config",
181     "//components/view_manager/public/cpp:common",
182     "//components/view_manager/public/interfaces",
183     "//mojo/application/public/interfaces",
184     "//mojo/converters/geometry",
185     "//mojo/converters/input_events",
186     "//mojo/environment:chromium",
187     "//mojo/platform_handle",
188     "//third_party/mojo/src/mojo/edk/test:run_all_unittests",
189     "//third_party/mojo/src/mojo/public/cpp/bindings:bindings",
190     "//ui/mojo/geometry:interfaces",
191     "//ui/mojo/events:interfaces",
192     "//testing/gtest",
193     "//ui/gfx",
194     "//ui/gfx:test_support",
195     "//ui/gfx/geometry",
196   ]
198   if (!is_android) {  # TODO(GYP) Enable on Android when osmesa links.
199     deps += [ "//third_party/mesa:osmesa" ]
200   }
203 mojo_native_application("apptests") {
204   output_name = "view_manager_apptests"
205   testonly = true
207   sources = [
208     "view_manager_client_apptest.cc",
209     "view_manager_service_apptest.cc",
210   ]
212   deps = [
213     ":test_support",
214     "//base",
215     "//base/test:test_config",
216     "//components/view_manager/public/cpp",
217     "//components/view_manager/public/cpp/tests:test_support",
218     "//components/view_manager/public/interfaces",
219     "//mojo/application/public/cpp:test_support",
220     "//ui/mojo/geometry:interfaces",
221     "//ui/mojo/geometry:util",
222   ]
224   data_deps = [ ":view_manager" ]