chromium/services/device/hid/hid_connection_unittest.cc

// Copyright 2014 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.h"

#include <stddef.h>

#include <memory>
#include <string>
#include <vector>

#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/memory/ref_counted_memory.h"
#include "base/run_loop.h"
#include "base/scoped_observation.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/task_environment.h"
#include "base/test/test_future.h"
#include "base/test/test_io_thread.h"
#include "build/build_config.h"
#include "services/device/hid/hid_connection.h"
#include "services/device/hid/hid_service.h"
#include "services/device/public/cpp/test/test_report_descriptors.h"
#include "services/device/public/mojom/hid.mojom.h"
#include "services/device/test/usb_test_gadget.h"
#include "services/device/usb/usb_device.h"
#include "services/device/usb/usb_service.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace device {

namespace {

TestFuture;

// Helper class that can be used to block until a HID device with a particular
// serial number is available. Example usage:
//
//   DeviceCatcher device_catcher("ABC123");
//   std::string device_guid = device_catcher.WaitForDevice();
//   /* Call HidService::Connect(device_guid) to open the device. */
//
class DeviceCatcher : HidService::Observer {};

class TestConnectCallback {};

class TestIoCallback {};

}  // namespace

class HidConnectionTest : public testing::Test {};

TEST_F(HidConnectionTest, ReadWrite) {}

namespace {

// A test implementation of HidConnection where the platform operations always
// succeed.
class TestHidConnection : public HidConnection {};

}  // namespace

class HidConnectionProtectedReportTest : public testing::Test,
                                         HidConnection::Client {};

TEST_F(HidConnectionProtectedReportTest, UnprotectedReadWrite) {}

TEST_F(HidConnectionProtectedReportTest, ProtectedReportsWithClient) {}

TEST_F(HidConnectionProtectedReportTest, ProtectedInputReportWithoutClient) {}

}  // namespace device