1# Copyright 2013 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. 4 5{ 6 'variables': { 7 'chromium_code': 1, 8 }, 9 'targets': [ 10 { 11 'target_name': 'ui_test_support', 12 'dependencies': [ 13 '../base/base.gyp:base', 14 '../skia/skia.gyp:skia', 15 '../testing/gtest.gyp:gtest', 16 'gfx/gfx.gyp:gfx', 17 ], 18 'sources': [ 19 'base/test/cocoa_test_event_utils.h', 20 'base/test/cocoa_test_event_utils.mm', 21 'base/test/ui_cocoa_test_helper.h', 22 'base/test/ui_cocoa_test_helper.mm', 23 'base/test/ui_controls.h', 24 'base/test/ui_controls_aura.cc', 25 'base/test/ui_controls_gtk.cc', 26 'base/test/ui_controls_internal_win.cc', 27 'base/test/ui_controls_internal_win.h', 28 'base/test/ui_controls_mac.mm', 29 'base/test/ui_controls_win.cc', 30 'gfx/test/color_util.cc', 31 'gfx/test/color_util.h', 32 ], 33 'include_dirs': [ 34 '../', 35 ], 36 'conditions': [ 37 ['OS!="ios"', { 38 'type': 'static_library', 39 'includes': [ 'base/ime/ime_test_support.gypi' ], 40 }, { # OS=="ios" 41 # None of the sources in this target are built on iOS, resulting in 42 # link errors when building targets that depend on this target 43 # because the static library isn't found. If this target is changed 44 # to have sources that are built on iOS, the target should be changed 45 # to be of type static_library on all platforms. 46 'type': 'none', 47 # The cocoa files don't apply to iOS. 48 'sources/': [['exclude', 'cocoa']], 49 }], 50 ['chromeos==1', { 51 'dependencies': [ 52 '../chromeos/chromeos.gyp:chromeos_test_support_without_gmock', 53 '../skia/skia.gyp:skia', 54 ], 55 }], 56 ['use_aura==1', { 57 'sources!': [ 58 'base/test/ui_controls_win.cc', 59 ], 60 }], 61 ], 62 }, 63 { 64 'target_name': 'run_ui_unittests', 65 'type': 'static_library', 66 'dependencies': [ 67 '../base/base.gyp:base', 68 '../base/base.gyp:test_support_base', 69 'ui.gyp:ui', 70 ], 71 'sources': [ 72 'test/test_suite.cc', 73 'test/test_suite.h', 74 'test/run_all_unittests.cc', 75 ], 76 }, 77 { 78 'target_name': 'ui_unittests', 79 'type': '<(gtest_target_type)', 80 'dependencies': [ 81 '../base/base.gyp:base', 82 '../base/base.gyp:test_support_base', 83 '../skia/skia.gyp:skia', 84 '../testing/gmock.gyp:gmock', 85 '../testing/gtest.gyp:gtest', 86 '../third_party/icu/icu.gyp:icui18n', 87 '../third_party/icu/icu.gyp:icuuc', 88 '../third_party/libpng/libpng.gyp:libpng', 89 '../url/url.gyp:url_lib', 90 'base/strings/ui_strings.gyp:ui_strings', 91 'events/events.gyp:events_base', 92 'resources/ui_resources.gyp:ui_resources', 93 'run_ui_unittests', 94 'shell_dialogs/shell_dialogs.gyp:shell_dialogs', 95 'ui.gyp:ui', 96 'ui_test_support', 97 ], 98 # iOS uses a small subset of ui. common_sources are the only files that 99 # are built on iOS. 100 'common_sources' : [ 101 'base/layout_unittest.cc', 102 'base/l10n/l10n_util_mac_unittest.mm', 103 'base/l10n/l10n_util_unittest.cc', 104 'base/l10n/l10n_util_win_unittest.cc', 105 'base/l10n/time_format_unittest.cc', 106 'base/models/tree_node_iterator_unittest.cc', 107 'base/resource/data_pack_literal.cc', 108 'base/resource/data_pack_unittest.cc', 109 'base/resource/resource_bundle_unittest.cc', 110 'gfx/animation/animation_container_unittest.cc', 111 'gfx/animation/animation_unittest.cc', 112 'gfx/animation/multi_animation_unittest.cc', 113 'gfx/animation/slide_animation_unittest.cc', 114 'gfx/box_unittest.cc', 115 'gfx/codec/png_codec_unittest.cc', 116 'gfx/color_utils_unittest.cc', 117 'gfx/display_unittest.cc', 118 'gfx/font_unittest.cc', 119 'gfx/image/image_family_unittest.cc', 120 'gfx/image/image_skia_unittest.cc', 121 'gfx/image/image_unittest.cc', 122 'gfx/image/image_unittest_util.cc', 123 'gfx/image/image_unittest_util.h', 124 'gfx/image/image_unittest_util_ios.mm', 125 'gfx/image/image_unittest_util_mac.mm', 126 'gfx/insets_unittest.cc', 127 'gfx/matrix3_unittest.cc', 128 'gfx/point_unittest.cc', 129 'gfx/point3_unittest.cc', 130 'gfx/quad_unittest.cc', 131 'gfx/range/range_mac_unittest.mm', 132 'gfx/range/range_unittest.cc', 133 'gfx/range/range_win_unittest.cc', 134 'gfx/rect_unittest.cc', 135 'gfx/safe_integer_conversions_unittest.cc', 136 'gfx/screen_unittest.cc', 137 'gfx/shadow_value_unittest.cc', 138 'gfx/size_unittest.cc', 139 'gfx/skbitmap_operations_unittest.cc', 140 'gfx/text_elider_unittest.cc', 141 'gfx/text_utils_unittest.cc', 142 'gfx/vector2d_unittest.cc', 143 'gfx/vector3d_unittest.cc', 144 ], 145 'all_sources': [ 146 '<@(_common_sources)', 147 'base/accelerators/accelerator_manager_unittest.cc', 148 'base/accelerators/menu_label_accelerator_util_linux_unittest.cc', 149 'base/clipboard/clipboard_unittest.cc', 150 'base/clipboard/custom_data_helper_unittest.cc', 151 'base/cocoa/base_view_unittest.mm', 152 'base/cocoa/cocoa_event_utils_unittest.mm', 153 'base/cocoa/controls/blue_label_button_unittest.mm', 154 'base/cocoa/controls/hover_image_menu_button_unittest.mm', 155 'base/cocoa/controls/hyperlink_button_cell_unittest.mm', 156 'base/cocoa/focus_tracker_unittest.mm', 157 'base/cocoa/fullscreen_window_manager_unittest.mm', 158 'base/cocoa/hover_image_button_unittest.mm', 159 'base/cocoa/menu_controller_unittest.mm', 160 'base/cocoa/nsgraphics_context_additions_unittest.mm', 161 'base/cocoa/tracking_area_unittest.mm', 162 'base/dragdrop/os_exchange_data_provider_aurax11_unittest.cc', 163 'base/gtk/gtk_expanded_container_unittest.cc', 164 'base/models/list_model_unittest.cc', 165 'base/models/list_selection_model_unittest.cc', 166 'base/models/tree_node_model_unittest.cc', 167 'base/test/data/resource.h', 168 'base/text/bytes_formatting_unittest.cc', 169 'base/view_prop_unittest.cc', 170 'base/webui/web_ui_util_unittest.cc', 171 'base/x/x11_util_unittest.cc', 172 'gfx/animation/tween_unittest.cc', 173 'gfx/blit_unittest.cc', 174 'gfx/break_list_unittest.cc', 175 'gfx/canvas_unittest.cc', 176 'gfx/canvas_unittest_mac.mm', 177 'gfx/codec/jpeg_codec_unittest.cc', 178 'gfx/color_analysis_unittest.cc', 179 'gfx/font_list_unittest.cc', 180 'gfx/image/image_mac_unittest.mm', 181 'gfx/image/image_util_unittest.cc', 182 'gfx/ozone/dri/hardware_display_controller_unittest.cc', 183 'gfx/ozone/dri/dri_surface_factory_unittest.cc', 184 'gfx/ozone/dri/dri_surface_unittest.cc', 185 'gfx/platform_font_mac_unittest.mm', 186 'gfx/render_text_unittest.cc', 187 'gfx/sequential_id_generator_unittest.cc', 188 'gfx/transform_util_unittest.cc', 189 'gfx/utf16_indexing_unittest.cc', 190 'shell_dialogs/select_file_dialog_win_unittest.cc', 191 ], 192 'include_dirs': [ 193 '../', 194 ], 195 'conditions': [ 196 ['OS!="ios"', { 197 'sources' : ['<@(_all_sources)'], 198 'includes': [ 199 'base/ime/ime_unittests.gypi', 200 ], 201 }, { # OS=="ios" 202 'sources' : [ 203 '<@(_common_sources)', 204 ], 205 # The ResourceBundle unittest expects a locale.pak file to exist in 206 # the bundle for English-US. Copy it in from where it was generated 207 # by ui_strings.gyp:ui_unittest_strings. 208 'mac_bundle_resources': [ 209 '<(PRODUCT_DIR)/ui_unittests_strings/en.lproj/locale.pak', 210 ], 211 }], 212 ['OS == "win"', { 213 'sources': [ 214 'test/ui_unittests.rc', 215 'base/dragdrop/os_exchange_data_win_unittest.cc', 216 'base/win/hwnd_subclass_unittest.cc', 217 'gfx/font_fallback_win_unittest.cc', 218 'gfx/icon_util_unittest.cc', 219 'gfx/platform_font_win_unittest.cc', 220 ], 221 'include_dirs': [ 222 '../..', 223 '../third_party/wtl/include', 224 ], 225 'msvs_settings': { 226 'VCLinkerTool': { 227 'DelayLoadDLLs': [ 228 'd2d1.dll', 229 'd3d10_1.dll', 230 ], 231 'AdditionalDependencies': [ 232 'd2d1.lib', 233 'd3d10_1.lib', 234 ], 235 }, 236 }, 237 'link_settings': { 238 'libraries': [ 239 '-limm32.lib', 240 '-loleacc.lib', 241 ], 242 }, 243 # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. 244 'msvs_disabled_warnings': [ 4267, ], 245 }], 246 ['OS != "mac" and OS != "ios"', { 247 'sources': [ 248 'gfx/transform_unittest.cc', 249 'gfx/interpolated_transform_unittest.cc', 250 ], 251 }], 252 ['OS == "android" and gtest_target_type == "shared_library"', { 253 'dependencies': [ 254 '../testing/android/native_test.gyp:native_test_native_code', 255 ], 256 }], 257 ['desktop_linux == 1 or chromeos == 1 or OS == "ios"', { 258 'dependencies': [ 259 'base/strings/ui_strings.gyp:ui_unittest_strings', 260 ], 261 }], 262 ['use_pango == 1', { 263 'dependencies': [ 264 '../build/linux/system.gyp:fontconfig', 265 '../build/linux/system.gyp:pangocairo', 266 ], 267 'sources': [ 268 'gfx/platform_font_pango_unittest.cc', 269 ], 270 'conditions': [ 271 ['linux_use_tcmalloc==1', { 272 'dependencies': [ 273 '../base/allocator/allocator.gyp:allocator', 274 ], 275 }], 276 ['toolkit_views==1', { 277 'sources!': [ 278 'browser/ui/gtk/gtk_expanded_container_unittest.cc', 279 ], 280 }], 281 ], 282 }], 283 ['use_x11==1', { 284 'dependencies': [ 285 '../tools/xdisplaycheck/xdisplaycheck.gyp:xdisplaycheck', 286 ], 287 }], 288 ['toolkit_uses_gtk == 1', { 289 'sources': [ 290 'base/dragdrop/gtk_dnd_util_unittest.cc', 291 ], 292 'dependencies': [ 293 '../build/linux/system.gyp:gtk', 294 ], 295 }], 296 ['OS=="android" or OS=="ios"', { 297 'sources!': [ 298 'gfx/render_text_unittest.cc', 299 ], 300 }], 301 ['OS!="win" or use_aura==0', { 302 'sources!': [ 303 'base/view_prop_unittest.cc', 304 ], 305 }], 306 ['use_x11==1 and use_aura==1', { 307 'sources': [ 308 'base/cursor/cursor_loader_x11_unittest.cc', 309 ], 310 }], 311 ['use_aura==1 or toolkit_views==1', { 312 'sources': [ 313 'base/dragdrop/os_exchange_data_unittest.cc', 314 ], 315 'dependencies': [ 316 'events/events.gyp:events', 317 'events/events.gyp:events_base', 318 'events/events.gyp:events_test_support', 319 ], 320 }], 321 ['use_aura==1', { 322 'sources!': [ 323 'base/dialogs/select_file_dialog_win_unittest.cc', 324 'base/dragdrop/os_exchange_data_win_unittest.cc', 325 'gfx/screen_unittest.cc', 326 ], 327 }], 328 ['use_ozone==1', { 329 'dependencies': [ 330 '<(DEPTH)/build/linux/system.gyp:dridrm', 331 ], 332 }], 333 ['use_ozone==1 and use_pango==0', { 334 'sources!': [ 335 'gfx/text_elider_unittest.cc', 336 'gfx/font_unittest.cc', 337 'gfx/font_list_unittest.cc', 338 'gfx/render_text_unittest.cc', 339 'gfx/canvas_unittest.cc', 340 ], 341 }], 342 ['chromeos==1', { 343 'sources!': [ 344 'base/dragdrop/os_exchange_data_provider_aurax11_unittest.cc', 345 ], 346 }], 347 ], 348 'target_conditions': [ 349 ['OS == "ios"', { 350 'sources/': [ 351 # Pull in specific Mac files for iOS (which have been filtered out 352 # by file name rules). 353 ['include', '^base/l10n/l10n_util_mac_unittest\\.mm$'], 354 ], 355 }], 356 ], 357 }, 358 ], 359 'conditions': [ 360 # Special target to wrap a gtest_target_type==shared_library 361 # ui_unittests into an android apk for execution. 362 # See base.gyp for TODO(jrg)s about this strategy. 363 ['OS == "android" and gtest_target_type == "shared_library"', { 364 'targets': [ 365 { 366 'target_name': 'ui_unittests_apk', 367 'type': 'none', 368 'dependencies': [ 369 'ui_unittests', 370 ], 371 'variables': { 372 'test_suite_name': 'ui_unittests', 373 'input_shlib_path': '<(SHARED_LIB_DIR)/<(SHARED_LIB_PREFIX)ui_unittests<(SHARED_LIB_SUFFIX)', 374 }, 375 'includes': [ '../build/apk_test.gypi' ], 376 }, 377 ], 378 }], 379 ], 380} 381