chromium/device/gamepad/abstract_haptic_gamepad_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 "device/gamepad/abstract_haptic_gamepad.h"

#include <memory>

#include "base/functional/bind.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/public/mojom/gamepad.mojom.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace device {

namespace {

// Use 1 ms for all non-zero effect durations. There is no reason to test longer
// delays as they will be skipped anyway.
constexpr double kDurationMillis =;
constexpr double kNonZeroStartDelayMillis =;
// Setting |start_delay| to zero can cause additional reports to be sent.
constexpr double kZeroStartDelayMillis =;
// Vibration magnitudes for the strong and weak channels of a typical
// dual-rumble vibration effect.
constexpr double kStrongMagnitude =;  // 100% intensity
constexpr double kWeakMagnitude =;    // 50% intensity

constexpr base::TimeDelta kPendingTaskDuration =;

// An implementation of AbstractHapticGamepad that records how many times its
// SetVibration and SetZeroVibration methods have been called.
class FakeHapticGamepad final : public AbstractHapticGamepad {};

// Main test fixture
class AbstractHapticGamepadTest : public testing::Test {};

TEST_F(AbstractHapticGamepadTest, PlayEffectTest) {}

TEST_F(AbstractHapticGamepadTest, ResetVibrationTest) {}

TEST_F(AbstractHapticGamepadTest, UnsupportedEffectTypeTest) {}

TEST_F(AbstractHapticGamepadTest, StartDelayTest) {}

TEST_F(AbstractHapticGamepadTest, ZeroStartDelayPreemptionTest) {}

TEST_F(AbstractHapticGamepadTest, NonZeroStartDelayPreemptionTest) {}

TEST_F(AbstractHapticGamepadTest, ResetVibrationPreemptionTest) {}

}  // namespace

}  // namespace device