#include "device/gamepad/dualshock4_controller.h"
#include <memory>
#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/weak_ptr.h"
#include "base/run_loop.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/task_environment.h"
#include "device/gamepad/hid_writer.h"
#include "device/gamepad/public/mojom/gamepad.mojom.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace device {
namespace {
constexpr size_t kUsbReportLength = …;
constexpr size_t kBluetoothReportLength = …;
constexpr uint8_t kUsbStopVibration[] = …;
static_assert …;
constexpr uint8_t kUsbStartVibration[] = …;
static_assert …;
constexpr uint8_t kBtStopVibration[] = …;
static_assert …;
constexpr uint8_t kBtStartVibration[] = …;
static_assert …;
constexpr double kDurationMillis = …;
constexpr double kZeroStartDelayMillis = …;
constexpr double kStrongMagnitude = …;
constexpr double kWeakMagnitude = …;
constexpr base::TimeDelta kPendingTaskDuration = …;
class FakeHidWriter : public HidWriter { … };
class Dualshock4ControllerTest : public testing::Test { … };
TEST_F(Dualshock4ControllerTest, PlayEffectUsb) { … }
TEST_F(Dualshock4ControllerTest, PlayEffectBluetooth) { … }
TEST_F(Dualshock4ControllerTest, ResetVibrationUsb) { … }
TEST_F(Dualshock4ControllerTest, ResetVibrationBluetooth) { … }
}
}