Index: ui/base/BUILD.gn |
diff --git a/ui/base/BUILD.gn b/ui/base/BUILD.gn |
index 00994275e34f0c9a7a649d785cd8ce1fc2ad1264..cf5f816ecd056a832130a10c9eb27d23ba214ec0 100644 |
--- a/ui/base/BUILD.gn |
+++ b/ui/base/BUILD.gn |
@@ -596,3 +596,199 @@ if (is_android) { |
jni_package = "base" |
} |
} |
+ |
+# TODO(GYP): Make this work on Android and reenable it. |
+if (!is_android) { |
+# GYP version: ui/base/ui_base_tests.gyp:ui_unittests |
+test("unittests") { |
+ # TODO(tfarina): Rename this target to ui_base_unittests. |
+ # In order to do this we will need to keep this target, add a dummy |
+ # ui_base_unittests target that just points to ui_unittests, change |
+ # buildbot code to reference the new 'ui_base_unittests' target. |
+ # After buildbot is updated, we can make the changes in Chromium and |
+ # remove 'ui_unittests' target. crbug.com/331829 |
+ output_name = "ui_unittests" |
+ sources = [ |
+ "l10n/l10n_util_mac_unittest.mm", |
+ "l10n/l10n_util_unittest.cc", |
+ "l10n/l10n_util_win_unittest.cc", |
+ "l10n/time_format_unittest.cc", |
+ "layout_unittest.cc", |
+ "models/tree_node_iterator_unittest.cc", |
+ "resource/data_pack_literal.cc", |
+ "resource/data_pack_unittest.cc", |
+ "resource/resource_bundle_unittest.cc", |
+ "test/run_all_unittests.cc", |
+ ] |
+ |
+ if (is_ios) { |
+ # Compile this Mac file on iOS as well. |
+ set_sources_assignment_filter([]) |
+ sources += [ "l10n/l10n_util_mac_unittest.mm" ] |
+ set_sources_assignment_filter(sources_assignment_filter) |
+ } else { # !is_ios |
+ sources += [ |
+ "accelerators/accelerator_manager_unittest.cc", |
+ "accelerators/menu_label_accelerator_util_linux_unittest.cc", |
+ "clipboard/custom_data_helper_unittest.cc", |
+ "cocoa/base_view_unittest.mm", |
+ "cocoa/cocoa_base_utils_unittest.mm", |
+ "cocoa/controls/blue_label_button_unittest.mm", |
+ "cocoa/controls/hover_image_menu_button_unittest.mm", |
+ "cocoa/controls/hyperlink_button_cell_unittest.mm", |
+ "cocoa/focus_tracker_unittest.mm", |
+ "cocoa/fullscreen_window_manager_unittest.mm", |
+ "cocoa/hover_image_button_unittest.mm", |
+ "cocoa/menu_controller_unittest.mm", |
+ "cocoa/nsgraphics_context_additions_unittest.mm", |
+ "cocoa/tracking_area_unittest.mm", |
+ "dragdrop/os_exchange_data_provider_aurax11_unittest.cc", |
+ "ime/candidate_window_unittest.cc", |
+ "ime/chromeos/character_composer_unittest.cc", |
+ "ime/composition_text_util_pango_unittest.cc", |
+ "ime/input_method_base_unittest.cc", |
+ "ime/input_method_chromeos_unittest.cc", |
+ "ime/remote_input_method_win_unittest.cc", |
+ "ime/win/imm32_manager_unittest.cc", |
+ "ime/win/tsf_input_scope_unittest.cc", |
+ "models/list_model_unittest.cc", |
+ "models/list_selection_model_unittest.cc", |
+ "models/tree_node_model_unittest.cc", |
+ "test/data/resource.h", |
+ "text/bytes_formatting_unittest.cc", |
+ "view_prop_unittest.cc", |
+ "webui/web_ui_util_unittest.cc", |
+ "x/selection_requestor_unittest.cc", |
+ ] |
+ |
+ if (!use_x11) { |
+ if (is_chromeos) { |
+ # These were already removed in the chromeos case. |
+ sources -= [ |
+ "ime/chromeos/character_composer_unittest.cc", |
+ "ime/input_method_chromeos_unittest.cc", |
+ ] |
+ } |
+ sources -= [ "ime/composition_text_util_pango_unittest.cc" ] |
+ } |
+ } |
+ |
+ deps = [ |
+ "//base", |
+ "//base/allocator", |
+ "//base/test:test_support", |
+ "//net", |
+ "//skia", |
+ "//testing/gmock", |
+ "//testing/gtest", |
+ "//third_party/icu", |
+ "//ui/base", |
+ "//ui/base:test_support", |
+ "//ui/events:events_base", |
+ "//ui/events:test_support", |
+ "//ui/gfx:test_support", |
+ "//ui/resources", |
+ "//ui/resources:ui_test_pak", |
+ "//ui/strings", |
+ "//url", |
+ ] |
+ |
+ if (is_ios) { |
+ # TODO(GYP) lots of iOS-only steps for ui_unittests |
+ } |
+ |
+ if (is_win) { |
+ sources += [ |
+ "dragdrop/os_exchange_data_win_unittest.cc", |
+ "win/hwnd_subclass_unittest.cc", |
+ "win/open_file_name_win_unittest.cc", |
+ ] |
+ |
+ ldflags = [ |
+ "/DELAYLOAD:d2d1.dll", |
+ "/DELAYLOAD:d3d10_1.dll", |
+ ] |
+ libs = [ |
+ "d2d1.lib", |
+ "d3d10_1.lib", |
+ "imm32.lib", |
+ "oleacc.lib", |
+ ] |
+ |
+ # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. |
+ cflags = [ "/wd4267" ] |
+ } |
+ |
+ if (is_android) { |
+ deps += [ |
+ #"testing/android/native_test.gyp:native_test_native_code" TODO(GYP) |
+ ] |
+ } |
+ |
+ if (use_pango) { |
+ configs += [ |
+ "//build/config/linux:pangocairo" |
+ ] |
+ } |
+ |
+ if (use_x11) { |
+ sources += [ |
+ "cursor/cursor_loader_x11_unittest.cc" |
+ ] |
+ |
+ configs += [ |
+ "//build/config/linux:x11" |
+ ] |
+ |
+ deps += [ |
+ "//ui/events/platform/x11", |
+ "//ui/gfx/x", |
+ ] |
+ |
+ datadeps = [ |
+ "//tools/xdisplaycheck" |
+ ] |
+ } |
+ |
+ if (!is_win || !use_aura) { |
+ sources -= [ |
+ "view_prop_unittest.cc" |
+ ] |
+ } |
+ |
+ if (is_mac) { |
+ deps += [ |
+ "//third_party/mozilla", |
+ #'ui_unittests_bundle', TODO(GYP) |
+ ] |
+ } |
+ |
+ if (use_aura || toolkit_views) { |
+ sources += [ |
+ "dragdrop/os_exchange_data_unittest.cc" |
+ ] |
+ |
+ deps += [ |
+ "//ui/events", |
+ "//ui/events/platform", |
+ ] |
+ } |
+ |
+ if (is_chromeos) { |
+ sources += [ |
+ "../chromeos/touch_exploration_controller_unittest.cc", |
+ ] |
+ sources -= [ |
+ "dragdrop/os_exchange_data_provider_aurax11_unittest.cc", |
+ "x/selection_requestor_unittest.cc", |
+ ] |
+ deps += [ |
+ "//ui/aura:test_support", |
+ "//ui/events:gesture_detection", |
+ #'../chromeos/chromeos.gyp:chromeos', TODO(GYP) |
+ #'chromeos/ui_chromeos.gyp:ui_chromeos', |
+ ] |
+ } |
+} |
+} |
+# TODO(GYP) Mac (ui_unittest_bundle) and Android (ui_unittests_apk). |