gl/test: Move some initialization code used in tests to a separate component.
[chromium-blink-merge.git] / components / view_manager / BUILD.gn
blobc7475d94aac436b4548e58afe1c19c3043420e0b
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       "native_viewport",
18     ]
19   }
21   source_set("loader") {
22     sources = [
23       "android_loader.cc",
24       "android_loader.h",
25     ]
27     deps = [
28       "public/interfaces",
29       "//mojo/services/tracing:lib",
30       "//third_party/mojo/src/mojo/public/cpp/bindings",
31     ]
32   }
33 } else {
34   mojo_native_application("view_manager") {
35     sources = [
36       "main.cc",
37     ]
39     deps = [
40       ":lib",
41       "//base",
42       "//components/view_manager/public/interfaces",
43       "//components/view_manager/native_viewport",
44       "//mojo/application/public/cpp",
45       "//mojo/converters/geometry",
46       "//mojo/environment:chromium",
47       "//mojo/platform_handle",
48       "//third_party/mojo/src/mojo/public/cpp/bindings:bindings",
49       "//ui/events",
50       "//ui/events/platform",
51       "//ui/gl",
52     ]
54     data_deps = [ "//components/view_manager/surfaces" ]
55   }
58 source_set("lib") {
59   sources = [
60     "access_policy.h",
61     "access_policy_delegate.h",
62     "animation_runner.cc",
63     "animation_runner.h",
64     "animation_runner_observer.h",
65     "client_connection.cc",
66     "client_connection.h",
67     "connection_manager.cc",
68     "connection_manager.h",
69     "connection_manager_delegate.h",
70     "default_access_policy.cc",
71     "default_access_policy.h",
72     "display_manager.cc",
73     "display_manager.h",
74     "display_manager_delegate.h",
75     "display_manager_factory.h",
76     "event_dispatcher.cc",
77     "event_dispatcher.h",
78     "focus_controller.cc",
79     "focus_controller.h",
80     "focus_controller_delegate.h",
81     "gesture_manager.cc",
82     "gesture_manager.h",
83     "gesture_manager_delegate.h",
84     "scheduled_animation_group.cc",
85     "scheduled_animation_group.h",
86     "server_view.cc",
87     "server_view.h",
88     "server_view_delegate.h",
89     "server_view_drawn_tracker.cc",
90     "server_view_drawn_tracker.h",
91     "server_view_drawn_tracker_observer.h",
92     "server_view_observer.h",
93     "view_coordinate_conversions.cc",
94     "view_coordinate_conversions.h",
95     "view_locator.cc",
96     "view_locator.h",
97     "view_manager_app.cc",
98     "view_manager_app.h",
99     "view_manager_root_connection.cc",
100     "view_manager_root_connection.h",
101     "view_manager_root_delegate.h",
102     "view_manager_root_impl.cc",
103     "view_manager_root_impl.h",
104     "view_manager_service_impl.cc",
105     "view_manager_service_impl.h",
106     "window_manager_access_policy.cc",
107     "window_manager_access_policy.h",
108   ]
110   public_deps = [
111     "//components/view_manager/public/cpp",
112   ]
114   deps = [
115     "//base",
116     "//cc/surfaces",
117     "//cc/surfaces:surface_id",
118     "//components/view_manager/public/cpp:common",
119     "//components/view_manager/public/interfaces",
120     "//components/view_manager/native_viewport",
121     "//mojo/application/public/cpp",
122     "//mojo/common:tracing_impl",
123     "//mojo/converters/geometry",
124     "//mojo/converters/input_events",
125     "//mojo/converters/surfaces",
126     "//third_party/mojo/src/mojo/public/cpp/bindings:callback",
127     "//ui/events",
128     "//ui/events/platform",
129     "//ui/gfx",
130     "//ui/gfx/geometry",
131     "//ui/gl:test_support",
132     "//ui/mojo/events:interfaces",
133     "//ui/mojo/geometry:interfaces",
134     "//ui/platform_window:platform_impls",
135   ]
138 source_set("test_support") {
139   testonly = true
141   sources = [
142     "test_change_tracker.cc",
143     "test_change_tracker.h",
144   ]
146   deps = [
147     "//base",
148     "//components/view_manager/public/cpp",
149     "//components/view_manager/public/cpp:common",
150     "//components/view_manager/public/interfaces",
151     "//mojo/common",
152     "//third_party/mojo/src/mojo/public/cpp/bindings:bindings",
153     "//ui/mojo/geometry:interfaces",
154   ]
157 group("tests") {
158   testonly = true
159   deps = [
160     ":apptests",
161     ":view_manager_unittests",
162     "//components/view_manager/public/cpp/tests:mojo_view_manager_lib_unittests",
163   ]
166 test("view_manager_unittests") {
167   sources = [
168     "animation_runner_unittest.cc",
169     "focus_controller_unittest.cc",
170     "gesture_manager_unittest.cc",
171     "scheduled_animation_group_unittest.cc",
172     "server_view_drawn_tracker_unittest.cc",
173     "test_server_view_delegate.cc",
174     "test_server_view_delegate.h",
175     "view_coordinate_conversions_unittest.cc",
176     "view_manager_service_unittest.cc",
177   ]
179   deps = [
180     ":test_support",
181     ":lib",
182     "//base",
183     "//base/test:test_config",
184     "//components/view_manager/public/cpp:common",
185     "//components/view_manager/public/interfaces",
186     "//mojo/application/public/interfaces",
187     "//mojo/converters/geometry",
188     "//mojo/converters/input_events",
189     "//mojo/environment:chromium",
190     "//mojo/platform_handle",
191     "//third_party/mojo/src/mojo/edk/test:run_all_unittests",
192     "//third_party/mojo/src/mojo/public/cpp/bindings:bindings",
193     "//ui/mojo/geometry:interfaces",
194     "//ui/mojo/events:interfaces",
195     "//testing/gtest",
196     "//ui/gfx",
197     "//ui/gfx:test_support",
198     "//ui/gfx/geometry",
199   ]
201   if (!is_android) {  # TODO(GYP) Enable on Android when osmesa links.
202     deps += [ "//third_party/mesa:osmesa" ]
203   }
206 mojo_native_application("apptests") {
207   output_name = "view_manager_apptests"
208   testonly = true
210   sources = [
211     "view_manager_client_apptest.cc",
212     "view_manager_service_apptest.cc",
213   ]
215   deps = [
216     ":test_support",
217     "//base",
218     "//base/test:test_config",
219     "//components/view_manager/public/cpp",
220     "//components/view_manager/public/cpp/tests:test_support",
221     "//components/view_manager/public/interfaces",
222     "//mojo/application/public/cpp:test_support",
223     "//ui/mojo/geometry:interfaces",
224     "//ui/mojo/geometry:util",
225   ]
227   data_deps = [ ":view_manager" ]