Port live region ChromeVox tests.
[chromium-blink-merge.git] / ash / BUILD.gn
blob13850598d7fb83cb4112f3304adde5250c55cf42
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/features.gni")
6 import("//build/config/ui.gni")
8 gypi_values = exec_script(
9     "//build/gypi_to_gn.py",
10     [ rebase_path("ash.gyp") ],
11     "scope",
12     [ "ash.gyp" ])
14 component("ash") {
15   sources = gypi_values.ash_sources
17   defines = [ "ASH_IMPLEMENTATION" ]
19   deps = [
20     "//ash/resources",
21     "//ash/strings",
22     "//base",
23     "//base:i18n",
24     "//base/third_party/dynamic_annotations",
25     "//cc",
26     "//components/user_manager",
27     "//content/public/browser",
28     "//media",
29     "//net",
30     "//skia",
31     "//third_party/icu",
32     "//ui/accelerometer",
33     "//ui/accessibility",
34     "//ui/app_list",
35     "//ui/aura",
36     "//ui/base",
37     "//ui/compositor",
38     "//ui/events",
39     "//ui/events:events_base",
40     "//ui/gfx",
41     "//ui/gfx/geometry",
42     "//ui/keyboard",
43     "//ui/message_center",
44     "//ui/resources",
45     "//ui/strings",
46     "//ui/views",
47     "//ui/views/controls/webview",
48     "//ui/web_dialogs",
49     "//ui/wm",
50     "//url",
51   ]
53   forward_dependent_configs_from = [
54     "//ash/resources",
55     "//ash/strings",
56   ]
58   if (is_win) {
59     sources -= [
60       "sticky_keys/sticky_keys_controller.cc",
61       "sticky_keys/sticky_keys_controller.h",
62     ]
63     # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
64     cflags = [ "/wd4267" ]
65   }
67   if (use_x11) {
68     configs += [
69       "//build/config/linux:xfixes",
70     ]
71   } else {
72     sources -= [
73       "accelerators/key_hold_detector.cc",
74       "accelerators/key_hold_detector.h",
75       "accelerators/magnifier_key_scroller.cc",
76       "accelerators/magnifier_key_scroller.h",
77       "accelerators/spoken_feedback_toggler.cc",
78       "accelerators/spoken_feedback_toggler.h",
79     ]
80   }
82   if (is_chromeos) {
83     deps += [
84       "//device/bluetooth",
85       "//ui/display",
86       "//ui/display/util",
87       #'../chromeos/chromeos.gyp:chromeos',  TODO(GYP)
88       # Ash #includes power_supply_properties.pb.h directly.
89       #'../chromeos/chromeos.gyp:power_manager_proto',  TODO(GYP)
90       #'../ui/chromeos/ui_chromeos.gyp:ui_chromeos_resources',  TODO(GYP)
91       #'../ui/chromeos/ui_chromeos.gyp:ui_chromeos_strings',  TODO(GYP)
92       #'../ui/chromeos/ui_chromeos.gyp:ui_chromeos',  TODO(GYP)
93     ]
94   } else {
95     sources -= [
96       "display/display_configurator_animation.cc",
97       "display/display_configurator_animation.h",
98       "display/resolution_notification_controller.cc",
99       "display/resolution_notification_controller.h",
100       "system/tray/media_security/media_capture_observer.h",
101       "system/tray/media_security/multi_profile_media_tray_item.cc",
102       "system/tray/media_security/multi_profile_media_tray_item.h",
103     ]
104   }
106   if (!use_x11 || !is_chromeos) {
107     sources -= [
108       "touch/touch_transformer_controller.cc",
109       "touch/touch_transformer_controller.h",
110       "touch/touchscreen_util.cc",
111       "touch/touchscreen_util.h",
112     ]
113   }
115   if (!use_ozone) {
116     sources -= [
117       "host/ash_window_tree_host_ozone.cc",
118     ]
119   }
122 component("ash_with_content") {
123   sources = [
124     "content_support/ash_with_content_export.h",
125     "content_support/gpu_support_impl.cc",
126     "content_support/gpu_support_impl.h",
127     "screensaver/screensaver_view.cc",
128     "screensaver/screensaver_view.h",
129     "keyboard_overlay/keyboard_overlay_delegate.cc",
130     "keyboard_overlay/keyboard_overlay_delegate.h",
131     "keyboard_overlay/keyboard_overlay_view.cc",
132     "keyboard_overlay/keyboard_overlay_view.h",
133   ]
135   defines = [ "ASH_WITH_CONTENT_IMPLEMENTATION" ]
137   deps = [
138     ":ash",
139     "//base",
140     "//base/third_party/dynamic_annotations",
141     "//content/public/browser",
142     "//ipc",
143     "//skia",
144     "//ui/aura",
145     "//ui/base",
146     "//ui/compositor",
147     "//ui/events",
148     "//ui/gfx",
149     "//ui/gfx/geometry",
150     "//ui/resources",
151     "//ui/strings",
152     "//ui/views",
153     "//ui/views/controls/webview",
154     "//ui/web_dialogs",
155     "//url",
156   ]
158   forward_dependent_configs_from = [
159     ":ash",
160   ]
163 static_library("test_support") {
164   testonly = true
165   sources = gypi_values.ash_test_support_sources
167   deps = [
168     ":ash",
169     "//ash/resources",
170     "//content/test:test_support",
171     "//skia",
172     "//testing/gtest",
173     "//ui/accessibility",
174     "//ui/app_list",
175     "//ui/app_list:test_support",
176     "//ui/events:events_base",
177     "//ui/gl",
178     "//ui/views",
179     "//ui/views:test_support",
180   ]
182   forward_dependent_configs_from = [ ":ash" ]
184   if (is_win) {
185     sources += [
186       "test/test_metro_viewer_process_host.cc",
187       "test/test_metro_viewer_process_host.h",
188     ]
189     deps += [
190       "//ipc",
191       #'../ui/metro_viewer/metro_viewer.gyp:metro_viewer_messages',  TODO(GYP)
192       #'../win8/win8.gyp:metro_viewer',  TODO(GYP)
193       #'../win8/win8.gyp:test_support_win8',  TODO(GYP)
194       #'../win8/win8_tests.gyp:test_registrar',  TODO(GYP)
195     ]
196   }
199 static_library("ash_shell_lib") {
200   testonly = true
201   sources = gypi_values.ash_shell_lib_sources
203   deps = [
204     ":ash",
205     ":ash_with_content",
206     ":test_support",
207     "//ash/resources",
208     "//ash/strings",
209     "//base",
210     "//base:i18n",
211     #"//chrome:packed_resources",  TODO(GYP)
212     "//content",
213     "//content/shell:content_shell_lib",
214     "//net",
215     "//skia",
216     "//third_party/icu",
217     "//ui/app_list",
218     "//ui/aura",
219     "//ui/base",
220     "//ui/compositor",
221     "//ui/events",
222     "//ui/events:events_base",
223     "//ui/gfx",
224     "//ui/gfx/geometry",
225     "//ui/keyboard",
226     "//ui/message_center",
227     "//ui/resources",
228     "//ui/views",
229     "//ui/views:test_support",
230     "//ui/views/examples:views_examples_lib",
231     "//ui/views/examples:views_examples_with_content_lib",
232   ]
235 test("ash_unittests") {
236   sources = gypi_values.ash_unittests_sources
238   deps = [
239     ":ash",
240     ":ash_with_content",
241     ":test_support",
242     "//ash/resources",
243     "//ash/strings",
244     "//base",
245     "//base/allocator",
246     "//base/test:test_support",
247     "//components/user_manager",
248     "//content/public/browser",
249     "//content/test:test_support",
250     "//skia",
251     "//testing/gtest",
252     "//third_party/icu",
253     "//ui/accelerometer",
254     "//ui/accessibility",
255     "//ui/aura",
256     "//ui/aura:test_support",
257     "//ui/base",
258     "//ui/base:test_support",
259     "//ui/compositor",
260     "//ui/compositor:test_support",
261     "//ui/events",
262     "//ui/events:test_support",
263     "//ui/events:gesture_detection",
264     "//ui/gfx",
265     "//ui/gfx/geometry",
266     "//ui/keyboard",
267     "//ui/message_center",
268     "//ui/message_center:test_support",
269     "//ui/resources",
270     "//ui/views",
271     "//ui/views:test_support",
272     "//ui/views/controls/webview:test_support",
273     "//ui/web_dialogs:test_support",
274     "//ui/wm",
275     "//url",
276   ]
278   if (!is_chromeos) {
279     sources -= [
280       # TODO(zork): fix this test to build on Windows. See: crosbug.com/26906
281       "focus_cycler_unittest.cc",
282       # All tests for multiple displays: not supported on Windows Ash.
283       "wm/drag_window_resizer_unittest.cc",
284       # Can't resize on Windows Ash. http://crbug.com/165962
285       "magnifier/magnification_controller_unittest.cc",
286       "wm/workspace/workspace_window_resizer_unittest.cc",
287       "sticky_keys/sticky_keys_overlay_unittest.cc",
288       "system/tray/media_security/multi_profile_media_tray_item_unittest.cc",
289       "autoclick/autoclick_unittest.cc",
290     ]
291     sources += [
292       #'<(SHARED_INTERMEDIATE_DIR)/ui/resources/ui_unscaled_resources.rc',  TODO(GYP)
293     ]
294   }
296   if (is_win) {
297     cflags = [ "/wd4267" ]
298   }
300   if (!use_x11) {
301     sources -= [
302       "accelerators/magnifier_key_scroller_unittest.cc",
303       "accelerators/spoken_feedback_toggler_unittest.cc",
304     ]
305   }
306   if (is_chromeos) {
307     sources += [ "first_run/first_run_helper_unittest.cc" ]
308     deps += [
309       "//device/bluetooth",
310       "//ui/display",
311       "//ui/display:test_util",
312       "//ui/display/types",
313       #'../chromeos/chromeos.gyp:chromeos_test_support_without_gmock',  TODO(GYP)
314       #'../chromeos/chromeos.gyp:power_manager_proto',  TODO(GYP)
315     ]
316   } else {
317     sources -= [
318       "display/resolution_notification_controller_unittest.cc",
319       "touch/touchscreen_util_unittest.cc",
320     ]
321   }
323   if (!use_x11 || !is_chromeos) {
324     sources -= [ "touch/touch_transformer_controller_unittest.cc", ]
325   }
327   # TODO(GYP) is this necessary?
328   #['OS=="linux" and component=="shared_library" and use_allocator!="none"', {
329   # ldflags = "-rdynamic"
331   if (!is_chromeos || use_ozone) {
332     sources -= [
333       "sticky_keys/sticky_keys_unittest.cc",  # crbug.com/354035
334     ]
335   }
338 executable("ash_shell") {
339   testonly = true
340   sources = [
341     "shell/shell_main.cc",
342   ]
344   deps = [
345     ":ash_shell_lib",
346     "//components/user_manager",
347   ]
349   if (is_win) {
350     configs -= [ "//build/config/win:console" ]
351     configs += [ "//build/config/win:windowed" ]
352     deps += [
353       "//sandbox",
354     ]
355   }
357   if (is_chromeos) {
358     deps += [
359       "../device/bluetooth/bluetooth.gyp:device_bluetooth",
360     ]
361   }
364 test("ash_shell_unittests") {
365   sources = [
366     "shell/window_watcher_unittest.cc",
367     "test/ash_unittests.cc",
368   ]
370   deps = [
371     ":ash_shell_lib",
372     ":test_support",
373     "//base/test:test_support",
374     "//components/user_manager",
375     "//content/test:test_support",
376     "//skia",
377     "//testing/gtest",
378     "//ui/accessibility",
379   ]
381   if (is_chromeos) {
382     deps += [ "//ui/display" ]
383   }