chromium/services/device/hid/hid_connection_impl_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 "services/device/hid/hid_connection_impl.h"

#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/ref_counted_memory.h"
#include "base/test/test_future.h"
#include "build/build_config.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/receiver.h"
#include "mojo/public/cpp/bindings/self_owned_receiver.h"
#include "services/device/device_service_test_base.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace device {

namespace {

ElementsAre;

ReadFuture;
WriteFuture;
GetFeatureFuture;

#if BUILDFLAG(IS_MAC)
const uint64_t kTestDeviceId = 123;
#elif BUILDFLAG(IS_WIN)
const wchar_t* kTestDeviceId = L"123";
#else
const char* kTestDeviceId =;
#endif

// The report ID to use for reports sent to or received from the test device.
const uint8_t kTestReportId =;

// The max size of reports for the test device.
const uint64_t kMaxReportSizeBytes =;

// A mock HidConnection implementation that allows the test to simulate reports.
class MockHidConnection : public HidConnection {};

// An implementation of HidConnectionClient that enables the test to wait until
// an input report is received.
class TestHidConnectionClient : public mojom::HidConnectionClient {};

}  // namespace

class HidConnectionImplTest : public DeviceServiceTestBase {};

TEST_F(HidConnectionImplTest, ReadWrite) {}

TEST_F(HidConnectionImplTest, ReadWriteWithConnectionClient) {}

TEST_F(HidConnectionImplTest, DestroyWithPendingInputReport) {}

TEST_F(HidConnectionImplTest, DestroyWithPendingRead) {}

TEST_F(HidConnectionImplTest, WatcherClosedWhenHidConnectionClosed) {}

TEST_F(HidConnectionImplTest, HidConnectionClosedWhenWatcherClosed) {}

TEST_F(HidConnectionImplTest, ReadZeroLengthInputReport) {}

TEST_F(HidConnectionImplTest, ReadZeroLengthInputReportWithClient) {}

TEST_F(HidConnectionImplTest, WriteZeroLengthOutputReport) {}

TEST_F(HidConnectionImplTest, ReadZeroLengthFeatureReport) {}

TEST_F(HidConnectionImplTest, WriteZeroLengthFeatureReport) {}

}  // namespace device