#include <stddef.h>
#include <stdint.h>
#include <cstring>
#include <memory>
#include <set>
#include <utility>
#include "base/test/metrics/histogram_tester.h"
#include "base/test/simple_test_tick_clock.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/events/devices/x11/device_data_manager_x11.h"
#include "ui/events/devices/x11/touch_factory_x11.h"
#include "ui/events/event.h"
#include "ui/events/event_constants.h"
#include "ui/events/event_utils.h"
#include "ui/events/keycodes/dom/dom_code.h"
#include "ui/events/keycodes/dom/keycode_converter.h"
#include "ui/events/test/events_test_utils.h"
#include "ui/events/test/events_test_utils_x11.h"
#include "ui/events/test/keyboard_layout.h"
#include "ui/events/test/scoped_event_test_tick_clock.h"
#include "ui/events/types/event_type.h"
#include "ui/events/x/events_x_utils.h"
#include "ui/events/x/x11_event_translation.h"
#include "ui/gfx/geometry/point.h"
#include "ui/gfx/x/connection.h"
#include "ui/gfx/x/event.h"
#include "ui/gfx/x/xproto.h"
namespace ui {
namespace {
void InitButtonEvent(x11::Event* event,
bool is_press,
const gfx::Point& location,
int button,
x11::KeyButMask state) { … }
#if !BUILDFLAG(IS_CHROMEOS_ASH)
void InitKeyEvent(x11::Event* event,
bool is_press,
int keycode,
x11::KeyButMask state) { … }
#endif
float ComputeRotationAngle(float twist) { … }
std::string FlooredEventLocationString(const x11::Event& xev) { … }
x11::Input::Fp1616 ToFp1616(int x) { … }
}
class EventsXTest : public testing::Test { … };
TEST_F(EventsXTest, ButtonEvents) { … }
TEST_F(EventsXTest, AvoidExtraEventsOnWheelRelease) { … }
TEST_F(EventsXTest, EnterLeaveEvent) { … }
TEST_F(EventsXTest, XInputEnterLeaveEvent) { … }
TEST_F(EventsXTest, ClickCount) { … }
TEST_F(EventsXTest, TouchEventBasic) { … }
int GetTouchIdForTrackingId(uint32_t tracking_id) { … }
TEST_F(EventsXTest, TouchEventNotRemovingFromNativeMapping) { … }
TEST_F(EventsXTest, CopiedTouchEventNotRemovingFromXEventMapping) { … }
TEST_F(EventsXTest, DisableKeyboard) { … }
TEST_F(EventsXTest, DisableMouse) { … }
#if !BUILDFLAG(IS_CHROMEOS_ASH)
TEST_F(EventsXTest, ImeFabricatedKeyEvents) { … }
#endif
TEST_F(EventsXTest, IgnoresMotionEventForMouseWheelScroll) { … }
namespace {
base::TimeTicks TimeTicksFromMillis(int64_t millis) { … }
}
TEST_F(EventsXTest, TimestampRolloverAndAdjustWhenDecreasing) { … }
TEST_F(EventsXTest, NoTimestampRolloverWhenMonotonicIncreasing) { … }
TEST_F(EventsXTest, NativeEvent) { … }
TEST_F(EventsXTest, GetCharacter) { … }
#if !BUILDFLAG(IS_CHROMEOS)
TEST_F(EventsXTest, NormalizeKeyEventFlags) { … }
#endif
TEST_F(EventsXTest, KeyEventCode) { … }
namespace {
void SetKeyEventTimestamp(x11::Event* event, int64_t time64) { … }
void AdvanceKeyEventTimestamp(x11::Event* event) { … }
}
TEST_F(EventsXTest, AutoRepeat) { … }
TEST_F(EventsXTest, EventLatencyOSTouchHistograms) { … }
TEST_F(EventsXTest, EventLatencyOSMouseWheelHistogram) { … }
}