Temporarily make lastchange use only the git hash.
[chromium-blink-merge.git] / ui / BUILD.gn
blob7b7bedb4fd1b8a66c8d97a9d80d61371f744aea2
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       sources -= [
63         "base/ime/chromeos/character_composer_unittest.cc",
64         "base/ime/input_method_chromeos_unittest.cc",
65         "base/ime/composition_text_util_pango_unittest.cc",
66       ]
67     }
68   }
70   deps = [
71     "//base",
72     "//base/allocator",
73     "//base/test:test_support",
74     "//net",
75     "//skia",
76     "//testing/gmock",
77     "//testing/gtest",
78     "//third_party/icu",
79     "//ui/base",
80     "//ui/base:test_support",
81     "//ui/events:events_base",
82     "//ui/events:test_support",
83     "//ui/gfx:test_support",
84     "//ui/resources",
85     "//ui/resources:ui_test_pak",
86     "//ui/strings",
87     "//url",
88   ]
90   if (is_ios) {
91     # TODO(GYP) lots of iOS-only steps for ui_unittests
92   }
94   if (is_win) {
95     sources += [
96       "base/dragdrop/os_exchange_data_win_unittest.cc",
97       "base/win/hwnd_subclass_unittest.cc",
98       "base/win/open_file_name_win_unittest.cc",
99     ]
101     ldflags = [
102       "/DELAYLOAD:d2d1.dll",
103       "/DELAYLOAD:d3d10_1.dll",
104     ]
105     libs = [
106       "d2d1.lib",
107       "d3d10_1.lib",
108       "imm32.lib",
109       "oleacc.lib",
110     ]
112     # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
113     cflags = [ "/wd4267" ]
114   }
116   if (is_android) {
117     deps += [
118       #"testing/android/native_test.gyp:native_test_native_code"  TODO(GYP)
119     ]
120   }
122   if (use_pango) {
123     configs += [ "//build/config/linux:pangocairo" ]
124   }
126   if (use_x11) {
127     sources += [ "base/cursor/cursor_loader_x11_unittest.cc" ]
128     configs += [ "//build/config/linux:x11" ]
129     deps += [
130       "//ui/events/platform/x11",
131       "//ui/gfx/x",
132     ]
133     datadeps = [ "//tools/xdisplaycheck" ]
134   }
136   if (!is_win || !use_aura) {
137     sources -= [ "base/view_prop_unittest.cc" ]
138   }
140   if (is_mac) {
141     deps += [
142       #'../third_party/mozilla/mozilla.gyp:mozilla',  TODO(GYP)
143       #'ui_unittests_bundle',  TODO(GYP)
144     ]
145     if (!is_component_build) {
146       # Needed for mozilla.gyp.
147       ldflags = [ "-Wl,-ObjC" ]
148     }
149   }
151   if (use_aura || toolkit_views) {
152     sources += [ "base/dragdrop/os_exchange_data_unittest.cc" ]
153     deps += [
154       "//ui/events",
155       "//ui/events/platform",
156     ]
157   }
159   if (is_chromeos) {
160     sources += [
161       "chromeos/touch_exploration_controller_unittest.cc",
162     ]
163     sources -= [
164       "base/dragdrop/os_exchange_data_provider_aurax11_unittest.cc",
165       "base/x/selection_requestor_unittest.cc",
166     ]
167     deps += [
168       "//ui/aura:test_support",
169       #'../chromeos/chromeos.gyp:chromeos',  TODO(GYP)
170       #'chromeos/ui_chromeos.gyp:ui_chromeos',
171       #'events/events.gyp:gesture_detection',
172     ]
173   }
177 # TODO(GYP) Mac (ui_unittest_bundle) and Android (ui_unittests_apk).