chromium/ui/events/ozone/evdev/event_converter_evdev_impl_unittest.cc

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

#include "ui/events/ozone/evdev/event_converter_evdev_impl.h"

#include <linux/input.h>

#include <memory>
#include <utility>

#include "base/files/scoped_file.h"
#include "base/functional/bind.h"
#include "base/test/task_environment.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/re2/src/re2/re2.h"
#include "ui/events/event.h"
#include "ui/events/keycodes/dom/dom_code.h"
#include "ui/events/keycodes/keyboard_codes.h"
#include "ui/events/ozone/device/device_manager.h"
#include "ui/events/ozone/evdev/event_converter_test_util.h"
#include "ui/events/ozone/evdev/event_device_test_util.h"
#include "ui/events/ozone/evdev/event_factory_evdev.h"
#include "ui/events/ozone/evdev/keyboard_evdev.h"
#include "ui/events/ozone/evdev/testing/fake_cursor_delegate_evdev.h"
#include "ui/events/ozone/layout/stub/stub_keyboard_layout_engine.h"
#include "ui/events/test/scoped_event_test_tick_clock.h"

namespace ui {

const char kTestDevicePath[] =;

class MockEventConverterEvdevImpl : public EventConverterEvdevImpl {};

}  // namespace ui

constexpr char kDefaultDeviceLogDescription[] =;

constexpr char kLogitechKeyboardK120LogDescription[] =;

constexpr char kDrawciaStylusGarageLogDescription[] =;

constexpr char kRedrixTouchpadLogDescription[] =;

// Test fixture.
class EventConverterEvdevImplTest : public testing::Test {};

class EventConverterEvdevImplLogTest : public EventConverterEvdevImplTest {};

// Test fixture which defers device set up, tests need to call SetUpDevice().
class DeferDeviceSetUpEventConverterEvdevImplTest
    : public EventConverterEvdevImplTest {};

TEST_F(EventConverterEvdevImplTest, KeyPress) {}

TEST_F(EventConverterEvdevImplTest, KeyRepeat) {}

TEST_F(EventConverterEvdevImplTest, NoEvents) {}

TEST_F(EventConverterEvdevImplTest, KeyWithModifier) {}

TEST_F(EventConverterEvdevImplTest, KeyWithDuplicateModifier) {}

TEST_F(EventConverterEvdevImplTest, KeyWithLock) {}

TEST_F(EventConverterEvdevImplTest, MouseButton) {}

TEST_F(EventConverterEvdevImplTest, MouseMove) {}

TEST_F(EventConverterEvdevImplTest, UnmappedKeyPress) {}

TEST_F(EventConverterEvdevImplTest, ShouldReleaseKeysOnUnplug) {}

TEST_F(EventConverterEvdevImplTest, ShouldReleaseKeysOnSynDropped) {}

TEST_F(EventConverterEvdevImplTest, ShouldReleaseKeysOnDisable) {}


// Test that SetAllowedKeys() causes events for non-allowed keys to be dropped.
TEST_F(EventConverterEvdevImplTest, SetAllowedKeys) {}

// Test that if a non-allowed key is pressed when SetAllowedKeys() is called
// that the non-allowed key is released.
TEST_F(EventConverterEvdevImplTest, SetAllowedKeysBlockedKeyPressed) {}

TEST_F(EventConverterEvdevImplTest, SetBlockModifiers) {}

TEST_F(EventConverterEvdevImplTest, SetBlockModifiersWithModifierHeldDown) {}

TEST_F(EventConverterEvdevImplTest, ShouldSwapMouseButtonsFromUserPreference) {}

TEST_F(DeferDeviceSetUpEventConverterEvdevImplTest, KeyboardHasKeys) {}

// Verify log conversions for EventDeviceInfoImpl, base EventDeviceInfo,
// and InputDevice member.
TEST_F(EventConverterEvdevImplLogTest, Basic) {}

TEST_F(EventConverterEvdevImplLogTest, BasicKeyboard) {}

TEST_F(EventConverterEvdevImplLogTest, BasicStylusGarage) {}

TEST_F(EventConverterEvdevImplLogTest, BasicTouchpad) {}

// Twiddle each field that can reasonably be changed independently.
TEST_F(EventConverterEvdevImplLogTest, ChangeVendor) {}

TEST_F(EventConverterEvdevImplLogTest, ChangeProduct) {}

TEST_F(EventConverterEvdevImplLogTest, ChangeVersion) {}

TEST_F(EventConverterEvdevImplLogTest, ChangeName) {}

TEST_F(EventConverterEvdevImplLogTest, ChangeInputDeviceType) {}

TEST_F(EventConverterEvdevImplLogTest, ChangeEnabled) {}

TEST_F(EventConverterEvdevImplLogTest, ChangeKeyboardImposter) {}

TEST_F(EventConverterEvdevImplLogTest, ChangeMouseImposter) {}

TEST_F(EventConverterEvdevImplLogTest, ChangeKeyboardType) {}

TEST_F(EventConverterEvdevImplLogTest, ChangeCapslockLED) {}