Commit bfba046f authored by Michael Spang's avatar Michael Spang Committed by Commit Bot

events: ozone: Move unittests to separate build files

Create new source_sets in each directory with the unit tests for the
component that directory implements. This avoids having to add all tests
directly ui/events/BUILD.gn.

Bug: 1026406

Change-Id: Id3b462f655da31219c08131601e0bab8927bb1f8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1925674
Commit-Queue: Michael Spang <spang@chromium.org>
Reviewed-by: default avatarKevin Schoedel <kpschoedel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#717216}
parent 48b5123c
......@@ -619,40 +619,8 @@ if (!is_ios) {
sources += [ "devices/device_data_manager_unittest.cc" ]
}
if (use_ozone && (is_linux || is_chromeos)) {
sources += [
"ozone/chromeos/cursor_controller_unittest.cc",
"ozone/evdev/event_converter_evdev_impl_unittest.cc",
"ozone/evdev/event_converter_test_util.cc",
"ozone/evdev/event_converter_test_util.h",
"ozone/evdev/event_device_info_unittest.cc",
"ozone/evdev/event_device_test_util.cc",
"ozone/evdev/event_device_test_util.h",
"ozone/evdev/gamepad_event_converter_evdev_unittest.cc",
"ozone/evdev/input_injector_evdev_unittest.cc",
"ozone/evdev/tablet_event_converter_evdev_unittest.cc",
"ozone/evdev/testing/fake_cursor_delegate_evdev.h",
"ozone/evdev/touch_event_converter_evdev_unittest.cc",
"ozone/evdev/touch_filter/false_touch_finder_unittest.cc",
"ozone/evdev/touch_filter/heuristic_stylus_palm_detection_filter_unittest.cc",
"ozone/evdev/touch_filter/neural_stylus_palm_detection_filter_unittest.cc",
"ozone/evdev/touch_filter/neural_stylus_palm_detection_filter_util_unittest.cc",
"ozone/evdev/touch_filter/open_palm_detection_filter_unittest.cc",
"ozone/evdev/touch_filter/palm_detection_filter_factory_unittest.cc",
]
if (use_xkbcommon) {
sources += [
"ozone/layout/keyboard_layout_engine_unittest.cc",
"ozone/layout/xkb/xkb_keyboard_layout_engine_unittest.cc",
]
}
deps += [
"//ui/events/ozone",
"//ui/events/ozone/evdev",
"//ui/events/ozone/layout",
]
if (use_ozone) {
deps += [ "//ui/events/ozone:unittests" ]
}
if (use_aura) {
......
......@@ -53,4 +53,28 @@ if (use_ozone) {
deps += [ "//device/udev_linux" ]
}
}
source_set("unittests") {
testonly = true
sources = []
deps = [
":ozone",
"//base",
"//testing/gtest",
"//ui/events",
"//ui/events/ozone/layout:unittests",
"//ui/gfx:native_widget_types",
"//ui/gfx/geometry",
]
if (is_chromeos) {
sources += [ "chromeos/cursor_controller_unittest.cc" ]
}
if (is_linux) {
deps += [ "//ui/events/ozone/evdev:unittests" ]
}
}
}
......@@ -139,3 +139,41 @@ component("evdev") {
public_configs += [ ":evdev_gestures_config" ]
}
}
source_set("unittests") {
testonly = true
sources = [
"event_converter_evdev_impl_unittest.cc",
"event_converter_test_util.cc",
"event_converter_test_util.h",
"event_device_info_unittest.cc",
"event_device_test_util.cc",
"event_device_test_util.h",
"gamepad_event_converter_evdev_unittest.cc",
"input_injector_evdev_unittest.cc",
"tablet_event_converter_evdev_unittest.cc",
"testing/fake_cursor_delegate_evdev.h",
"touch_event_converter_evdev_unittest.cc",
"touch_filter/false_touch_finder_unittest.cc",
"touch_filter/heuristic_stylus_palm_detection_filter_unittest.cc",
"touch_filter/neural_stylus_palm_detection_filter_unittest.cc",
"touch_filter/neural_stylus_palm_detection_filter_util_unittest.cc",
"touch_filter/open_palm_detection_filter_unittest.cc",
"touch_filter/palm_detection_filter_factory_unittest.cc",
]
deps = [
":evdev",
"//base",
"//base/test:test_support",
"//testing/gmock",
"//testing/gtest",
"//ui/events",
"//ui/events:dom_keycode_converter",
"//ui/events/devices",
"//ui/events/ozone",
"//ui/events/ozone/layout",
"//ui/gfx/geometry",
]
}
......@@ -47,3 +47,23 @@ component("layout") {
deps += [ "//ui/events/keycodes:xkb" ]
}
}
source_set("unittests") {
testonly = true
sources = []
if (use_xkbcommon) {
sources += [
"keyboard_layout_engine_unittest.cc",
"xkb/xkb_keyboard_layout_engine_unittest.cc",
]
}
deps = [
":layout",
"//base",
"//testing/gtest",
"//ui/events",
"//ui/events:dom_keycode_converter",
]
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment