chromium/ui/ozone/platform/x11/test/events_x_unittest.cc

// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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 {

// Initializes the passed-in event.
void InitButtonEvent(x11::Event* event,
                     bool is_press,
                     const gfx::Point& location,
                     int button,
                     x11::KeyButMask state) {}

#if !BUILDFLAG(IS_CHROMEOS_ASH)
// Initializes the passed-in x11::Event.
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) {}

}  // namespace

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) {}

// Copied events should not remove native touch id mappings, as this causes a
// crash (crbug.com/467102). Copied events do not contain a proper
// PlatformEvent and should not attempt to access it.
TEST_F(EventsXTest, CopiedTouchEventNotRemovingFromXEventMapping) {}

// Verifies that the type of events from a disabled keyboard is
// EventType::kUnknown, but that an exception list of keys can still be
// processed.
TEST_F(EventsXTest, DisableKeyboard) {}

// Verifies that the type of events from a disabled mouse is
// EventType::kUnknown.
TEST_F(EventsXTest, DisableMouse) {}

#if !BUILDFLAG(IS_CHROMEOS_ASH)
TEST_F(EventsXTest, ImeFabricatedKeyEvents) {}
#endif

TEST_F(EventsXTest, IgnoresMotionEventForMouseWheelScroll) {}

namespace {

// Returns a fake TimeTicks based on the given millisecond offset.
base::TimeTicks TimeTicksFromMillis(int64_t millis) {}

}  // namespace

TEST_F(EventsXTest, TimestampRolloverAndAdjustWhenDecreasing) {}

TEST_F(EventsXTest, NoTimestampRolloverWhenMonotonicIncreasing) {}

// Moved from event_unittest.cc

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) {}

}  // namespace

TEST_F(EventsXTest, AutoRepeat) {}

// Checks that Event.Latency.OS2.TOUCH_PRESSED, TOUCH_MOVED,
// and TOUCH_RELEASED histograms are computed properly.
TEST_F(EventsXTest, EventLatencyOSTouchHistograms) {}

TEST_F(EventsXTest, EventLatencyOSMouseWheelHistogram) {}

}  // namespace ui