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")
7 import("//testing/test.gni")
9 gypi_values = exec_script("//build/gypi_to_gn.py",
10 [ rebase_path("views.gyp") ],
15 defines = [ "TOOLKIT_VIEWS=1" ]
19 all_dependent_configs = [ ":flags" ]
20 sources = gypi_values.views_sources
23 "//build/config:precompiled_headers",
25 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
26 "//build/config/compiler:no_size_t_to_int_warning",
29 defines = [ "VIEWS_IMPLEMENTATION" ]
33 "//base/third_party/dynamic_annotations",
40 "//ui/views/resources",
46 "//ui/accessibility:ax_gen",
51 "//ui/events:events_base",
52 "//ui/events/platform",
55 "//ui/views/resources",
58 if (use_x11 && !is_chromeos) {
59 deps += [ "//ui/display/util" ]
61 if (is_linux && !is_chromeos) {
62 sources -= [ "window/window_button_order_provider.cc" ]
63 deps += [ "//ui/shell_dialogs" ]
66 "linux_ui/linux_ui.cc",
67 "linux_ui/linux_ui.h",
68 "linux_ui/window_button_order_observer.h",
69 "linux_ui/window_button_order_provider.cc",
75 "linux_ui/status_icon_linux.cc",
76 "linux_ui/status_icon_linux.h",
81 sources += gypi_values.views_win_sources
87 ldflags = [ "/DELAYLOAD:user32.dll" ]
89 "//third_party/iaccessible2",
95 deps += [ "//ui/ozone" ]
99 "//build/config/linux:x11",
100 "//build/config/linux:xrandr",
103 "//ui/events/devices",
104 "//ui/events/platform/x11",
110 sources += gypi_values.views_aura_sources
113 "//ui/touch_selection",
117 sources += gypi_values.views_desktop_aura_sources
119 sources += gypi_values.views_desktop_aura_x11_sources
120 configs += [ "//ui/accessibility:atk" ]
122 sources += gypi_values.views_desktop_aura_win_sources
123 } else if (use_ozone) {
124 sources += gypi_values.views_desktop_aura_ozone_sources
127 sources += gypi_values.views_desktop_aura_linux_sources
133 deps += [ "//ui/accelerated_widget_mac" ]
135 # Required by bridged_native_widget.mm.
136 "QuartzCore.framework",
141 static_library("test_support") {
143 sources = gypi_values.views_test_support_sources
145 configs += [ "//build/config:precompiled_headers" ]
152 "//ipc:test_support",
158 "//ui/compositor:test_support",
160 "//ui/events:events_base",
161 "//ui/events:test_support",
162 "//ui/events/platform",
168 sources += gypi_values.views_test_support_aura_sources
171 "//ui/aura:test_support",
174 if (use_x11 && !is_chromeos) {
175 sources += gypi_values.views_test_support_desktop_aura_x11_sources
179 deps += [ "//ui/gfx/x" ]
181 if (use_ozone || !use_x11) {
182 sources -= [ "test/x11_property_change_waiter.cc" ]
186 test("views_unittests") {
187 sources = gypi_values.views_unittests_sources
194 "//base/test:test_support",
198 "//ui/accessibility",
201 "//ui/base:test_support",
202 "//ui/compositor:test_support",
203 "//ui/events:test_support",
204 "//ui/events:events_base",
205 "//ui/events/platform",
216 "//third_party/iaccessible2",
227 # 'VCManifestTool': {
228 # 'AdditionalManifestFiles': [
229 # '$(ProjectDir)\\test\\views_unittest.manifest',
237 "//build/config/linux:x11",
238 "//build/config/linux:xext",
241 "//ui/events/devices",
242 "//ui/events/platform/x11",
248 sources += gypi_values.views_unittests_aura_sources
251 "//ui/aura:test_support",
252 "//ui/touch_selection",
256 sources += gypi_values.views_unittests_desktop_aura_sources
258 sources += gypi_values.views_unittests_desktop_aurax11_sources
263 sources += gypi_values.views_unittests_desktop_sources
267 "//ui/events/platform/x11",
273 # views_unittests not yet compiling on Mac. http://crbug.com/378134
275 "bubble/bubble_window_targeter_unittest.cc",
276 "controls/native/native_view_host_unittest.cc",
277 "widget/window_reorderer_unittest.cc",
279 deps += [ "//ui/accelerated_widget_mac" ]
284 test("macviews_interactive_ui_tests") {
286 "cocoa/bridged_native_widget_interactive_uitest.mm",
287 "run_all_unittests.cc",
288 "widget/native_widget_mac_interactive_uitest.mm",
294 "//base/test:test_support",
297 "//ui/base:test_support",
300 "//ui/resources:ui_test_pak",