chromium/device/gamepad/gamepad_service_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.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/351564777): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "device/gamepad/gamepad_service.h"

#include <string.h>

#include <memory>

#include "base/barrier_closure.h"
#include "base/memory/raw_ptr.h"
#include "base/run_loop.h"
#include "base/test/gmock_callback_support.h"
#include "base/test/task_environment.h"
#include "device/gamepad/gamepad_consumer.h"
#include "device/gamepad/gamepad_test_helpers.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace device {

namespace {
RunClosure;

// The number of simulated gamepads that will be connected and disconnected in
// tests.
constexpr int kNumberOfGamepads =;
}  // namespace

class MockGamepadConsumer : public GamepadConsumer {};

class GamepadServiceTest : public testing::Test {};

TEST_F(GamepadServiceTest, ConnectionsTest) {}

TEST_F(GamepadServiceTest, ConnectionThenGestureTest) {}

TEST_F(GamepadServiceTest, ReloadTest) {}

TEST_F(GamepadServiceTest, SecondConsumerGestureTest) {}

TEST_F(GamepadServiceTest, ConnectWhileInactiveTest) {}

// https://crbug.com/1405460: Flaky on Android.
TEST_F(GamepadServiceTest, DISABLED_ConnectAndDisconnectWhileInactiveTest) {}

// https://crbug.com/1346527 Flaky on Android and Linux.
TEST_F(GamepadServiceTest, DISABLED_DisconnectWhileInactiveTest) {}

TEST_F(GamepadServiceTest, DisconnectAndConnectWhileInactiveTest) {}

TEST_F(GamepadServiceTest, ActiveConsumerBecameActive) {}

TEST_F(GamepadServiceTest, InactiveConsumerBecameInactive) {}

TEST_F(GamepadServiceTest, UnregisteredConsumerBecameInactive) {}

TEST_F(GamepadServiceTest, RemoveUnregisteredConsumer) {}

}  // namespace device