Claim some appcache histograms.
[chromium-blink-merge.git] / ui / BUILD.gn
blob506e557604dd8abd0ad7f4b1983a77e391a49c6f
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")
7 test("ui_unittests") {
8   sources = [
9     "base/layout_unittest.cc",
10     "base/l10n/l10n_util_mac_unittest.mm",
11     "base/l10n/l10n_util_unittest.cc",
12     "base/l10n/l10n_util_win_unittest.cc",
13     "base/l10n/time_format_unittest.cc",
14     "base/models/tree_node_iterator_unittest.cc",
15     "base/resource/data_pack_literal.cc",
16     "base/resource/data_pack_unittest.cc",
17     "base/resource/resource_bundle_unittest.cc",
18     "base/test/run_all_unittests.cc",
19   ]
21   if (is_ios) {
22     # Compile this Mac file on iOS as well.
23     set_sources_assignment_filter([])
24     sources += [ "base/l10n/l10n_util_mac_unittest.mm" ]
25     set_sources_assignment_filter(sources_assignment_filter)
26   } else {  # !is_ios
27     sources += [
28       "base/accelerators/accelerator_manager_unittest.cc",
29       "base/accelerators/menu_label_accelerator_util_linux_unittest.cc",
30       "base/clipboard/custom_data_helper_unittest.cc",
31       "base/cocoa/base_view_unittest.mm",
32       "base/cocoa/cocoa_base_utils_unittest.mm",
33       "base/cocoa/controls/blue_label_button_unittest.mm",
34       "base/cocoa/controls/hover_image_menu_button_unittest.mm",
35       "base/cocoa/controls/hyperlink_button_cell_unittest.mm",
36       "base/cocoa/focus_tracker_unittest.mm",
37       "base/cocoa/fullscreen_window_manager_unittest.mm",
38       "base/cocoa/hover_image_button_unittest.mm",
39       "base/cocoa/menu_controller_unittest.mm",
40       "base/cocoa/nsgraphics_context_additions_unittest.mm",
41       "base/cocoa/tracking_area_unittest.mm",
42       "base/dragdrop/os_exchange_data_provider_aurax11_unittest.cc",
43       "base/ime/candidate_window_unittest.cc",
44       "base/ime/chromeos/character_composer_unittest.cc",
45       "base/ime/composition_text_util_pango_unittest.cc",
46       "base/ime/input_method_base_unittest.cc",
47       "base/ime/input_method_chromeos_unittest.cc",
48       "base/ime/remote_input_method_win_unittest.cc",
49       "base/ime/win/imm32_manager_unittest.cc",
50       "base/ime/win/tsf_input_scope_unittest.cc",
51       "base/models/list_model_unittest.cc",
52       "base/models/list_selection_model_unittest.cc",
53       "base/models/tree_node_model_unittest.cc",
54       "base/test/data/resource.h",
55       "base/text/bytes_formatting_unittest.cc",
56       "base/view_prop_unittest.cc",
57       "base/webui/web_ui_util_unittest.cc",
58       "base/x/selection_requestor_unittest.cc",
59     ]
61     if (!use_x11) {
62       if (is_chromeos) {
63         # These were already removed in the chromeos case.
64         sources -= [
65           "base/ime/chromeos/character_composer_unittest.cc",
66           "base/ime/input_method_chromeos_unittest.cc",
67         ]
68       }
69       sources -= [ "base/ime/composition_text_util_pango_unittest.cc" ]
70     }
71   }
73   deps = [
74     "//base",
75     "//base/allocator",
76     "//base/test:test_support",
77     "//net",
78     "//skia",
79     "//testing/gmock",
80     "//testing/gtest",
81     "//third_party/icu",
82     "//ui/base",
83     "//ui/base:test_support",
84     "//ui/events:events_base",
85     "//ui/events:test_support",
86     "//ui/gfx:test_support",
87     "//ui/resources",
88     "//ui/resources:ui_test_pak",
89     "//ui/strings",
90     "//url",
91   ]
93   if (is_ios) {
94     # TODO(GYP) lots of iOS-only steps for ui_unittests
95   }
97   if (is_win) {
98     sources += [
99       "base/dragdrop/os_exchange_data_win_unittest.cc",
100       "base/win/hwnd_subclass_unittest.cc",
101       "base/win/open_file_name_win_unittest.cc",
102     ]
104     ldflags = [
105       "/DELAYLOAD:d2d1.dll",
106       "/DELAYLOAD:d3d10_1.dll",
107     ]
108     libs = [
109       "d2d1.lib",
110       "d3d10_1.lib",
111       "imm32.lib",
112       "oleacc.lib",
113     ]
115     # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
116     cflags = [ "/wd4267" ]
117   }
119   if (is_android) {
120     deps += [
121       #"testing/android/native_test.gyp:native_test_native_code"  TODO(GYP)
122     ]
123   }
125   if (use_pango) {
126     configs += [ "//build/config/linux:pangocairo" ]
127   }
129   if (use_x11) {
130     sources += [ "base/cursor/cursor_loader_x11_unittest.cc" ]
131     configs += [ "//build/config/linux:x11" ]
132     deps += [
133       "//ui/events/platform/x11",
134       "//ui/gfx/x",
135     ]
136     datadeps = [ "//tools/xdisplaycheck" ]
137   }
139   if (!is_win || !use_aura) {
140     sources -= [ "base/view_prop_unittest.cc" ]
141   }
143   if (is_mac) {
144     deps += [
145       #'../third_party/mozilla/mozilla.gyp:mozilla',  TODO(GYP)
146       #'ui_unittests_bundle',  TODO(GYP)
147     ]
148     if (!is_component_build) {
149       # Needed for mozilla.gyp.
150       ldflags = [ "-Wl,-ObjC" ]
151     }
152   }
154   if (use_aura || toolkit_views) {
155     sources += [ "base/dragdrop/os_exchange_data_unittest.cc" ]
156     deps += [
157       "//ui/events",
158       "//ui/events/platform",
159     ]
160   }
162   if (is_chromeos) {
163     sources += [
164       "chromeos/touch_exploration_controller_unittest.cc",
165     ]
166     sources -= [
167       "base/dragdrop/os_exchange_data_provider_aurax11_unittest.cc",
168       "base/x/selection_requestor_unittest.cc",
169     ]
170     deps += [
171       "//ui/aura:test_support",
172       #'../chromeos/chromeos.gyp:chromeos',  TODO(GYP)
173       #'chromeos/ui_chromeos.gyp:ui_chromeos',
174       #'events/events.gyp:gesture_detection',
175     ]
176   }
180 # TODO(GYP) Mac (ui_unittest_bundle) and Android (ui_unittests_apk).