chromium/device/gamepad/dualshock4_controller_unittest.cc

// Copyright 2019 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/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;

// 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 =;
// 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. kStartVibrationData describes a report with
// these magnitudes.
constexpr double kStrongMagnitude =;  // 100% intensity
constexpr double kWeakMagnitude =;    // 50% intensity

constexpr base::TimeDelta kPendingTaskDuration =;

class FakeHidWriter : public HidWriter {};

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

TEST_F(Dualshock4ControllerTest, PlayEffectUsb) {}

TEST_F(Dualshock4ControllerTest, PlayEffectBluetooth) {}

TEST_F(Dualshock4ControllerTest, ResetVibrationUsb) {}

TEST_F(Dualshock4ControllerTest, ResetVibrationBluetooth) {}

}  // namespace

}  // namespace device