#include "device/gamepad/hid_haptic_gamepad.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 uint8_t kReportId = …;
constexpr size_t kReportLength = …;
constexpr HidHapticGamepad::HapticReportData kHapticReportData = …;
constexpr uint8_t kStopVibrationData[] = …;
constexpr uint8_t kStartVibrationData[] = …;
constexpr double kDurationMillis = …;
constexpr double kNonZeroStartDelayMillis = …;
constexpr double kZeroStartDelayMillis = …;
constexpr double kStrongMagnitude = …;
constexpr double kWeakMagnitude = …;
constexpr double kZeroMagnitude = …;
constexpr base::TimeDelta kPendingTaskDuration = …;
class FakeHidWriter : public HidWriter { … };
class HidHapticGamepadTest : public testing::Test { … };
TEST_F(HidHapticGamepadTest, PlayEffectTest) { … }
TEST_F(HidHapticGamepadTest, ResetVibrationTest) { … }
TEST_F(HidHapticGamepadTest, ZeroVibrationTest) { … }
TEST_F(HidHapticGamepadTest, StartDelayTest) { … }
TEST_F(HidHapticGamepadTest, ZeroStartDelayPreemptionTest) { … }
TEST_F(HidHapticGamepadTest, NonZeroStartDelayPreemptionTest) { … }
TEST_F(HidHapticGamepadTest, ResetVibrationPreemptionTest) { … }
}
}