chromium/ui/ozone/platform/wayland/host/wayland_keyboard_unittest.cc

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

#include <linux/input.h>
#include <wayland-server.h>
#include <memory>

#include "base/memory/raw_ptr.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/test_mock_time_task_runner.h"
#include "base/timer/timer.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/events/devices/device_data_manager.h"
#include "ui/events/event.h"
#include "ui/ozone/platform/wayland/host/wayland_seat.h"
#include "ui/ozone/platform/wayland/test/mock_surface.h"
#include "ui/ozone/platform/wayland/test/test_keyboard.h"
#include "ui/ozone/platform/wayland/test/test_wayland_server_thread.h"
#include "ui/ozone/platform/wayland/test/wayland_test.h"

#if BUILDFLAG(USE_XKBCOMMON)
#include "base/memory/free_deleter.h"
#include "base/memory/platform_shared_memory_region.h"
#include "base/memory/shared_memory_mapping.h"
#include "base/memory/unsafe_shared_memory_region.h"
#include "ui/events/keycodes/scoped_xkb.h"  // nogncheck
#endif

_;
Mock;
NotNull;
Values;

namespace ui {

class WaylandKeyboardTest : public WaylandTestSimple {};

ACTION_P(CloneEvent, ptr) {}

ACTION_P(AppendEvent, ptr) {}

ACTION_P(AppendEventAndQuitLoop, ptr, event_count, closure) {}

TEST_F(WaylandKeyboardTest, Keypress) {}

TEST_F(WaylandKeyboardTest, ControlShiftModifiers) {}

#if BUILDFLAG(USE_XKBCOMMON)
TEST_F(WaylandKeyboardTest, CapsLockModifier) {}
#endif

TEST_F(WaylandKeyboardTest, EventAutoRepeat) {}

TEST_F(WaylandKeyboardTest, NoEventAutoRepeatOnLeave) {}

// This test verifies the following scenario:
//
// 1/ press and hold a modifier key (in this case SHIFT, ALT, CTRL);
// 2/ ensure that no auto-repeat gets triggered;
// 3/ with the modifier key still pressed, press another
//    key (in this case 'a');
// 4/ ensure that they auto-repeat logic gets started and
//    the modifier key is properly handled as part of the
//    event construction.
TEST_F(WaylandKeyboardTest, NoEventAutoRepeatForModifiers) {}

}  // namespace ui