chromium/remoting/host/linux/x11_character_injector_unittest.cc

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

#include "remoting/host/linux/x11_character_injector.h"

#include <unordered_map>

#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "base/test/task_environment.h"
#include "base/time/time.h"
#include "remoting/host/linux/x11_keyboard.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace {
constexpr base::TimeDelta kKeycodeReuseDuration =;
}

namespace remoting {

// This class acts as a simulated keyboard interface for testing that
// * Maintains a changeable simulated keyboard layout.
// * Verifies the correct sequence of characters are being typed.
// * Ensures that a key mapping can't be changed if the time elapsed since
//   last used is less than |kKeycodeReuseDuration|.
class FakeX11Keyboard : public X11Keyboard {};

FakeX11Keyboard::FakeX11Keyboard(
    const std::vector<uint32_t>& available_keycodes) {}

FakeX11Keyboard::~FakeX11Keyboard() {}

std::vector<uint32_t> FakeX11Keyboard::GetUnusedKeycodes() {}

void FakeX11Keyboard::PressKey(uint32_t keycode, uint32_t modifiers) {}

bool FakeX11Keyboard::FindKeycode(uint32_t code_point,
                                  uint32_t* keycode,
                                  uint32_t* modifiers) {}

bool FakeX11Keyboard::ChangeKeyMapping(uint32_t keycode, uint32_t code_point) {}

void FakeX11Keyboard::Flush() {}

void FakeX11Keyboard::Sync() {}

void FakeX11Keyboard::ExpectEnterCodePoints(
    const std::vector<uint32_t>& sequence) {}

class X11CharacterInjectorTest : public testing::Test {};

void X11CharacterInjectorTest::SetUp() {}

void X11CharacterInjectorTest::TearDown() {}

void X11CharacterInjectorTest::InjectAndRun(
    const std::vector<uint32_t>& code_points) {}

TEST_F(X11CharacterInjectorTest, TestNoMappingNoExpectation) {}

TEST_F(X11CharacterInjectorTest, TestTypeOneCharacter) {}

TEST_F(X11CharacterInjectorTest, TestMapCharactersUntilFull) {}

TEST_F(X11CharacterInjectorTest, TestMapOneCharacterWhenFull) {}

TEST_F(X11CharacterInjectorTest, TestReuseMappedCharacterOnce) {}

TEST_F(X11CharacterInjectorTest, TestReuseAllMappedCharactersInChangedOrder) {}

}  // namespace remoting