chromium/extensions/common/permissions/usb_device_permission_unittest.cc

// Copyright 2013 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include <memory>
#include <utility>

#include "base/memory/ref_counted.h"
#include "components/version_info/channel.h"
#include "extensions/common/extension_builder.h"
#include "extensions/common/features/feature_channel.h"
#include "extensions/common/features/feature_session_type.h"
#include "extensions/common/mojom/feature_session_type.mojom.h"
#include "extensions/common/permissions/usb_device_permission.h"
#include "extensions/common/permissions/usb_device_permission_data.h"
#include "services/device/public/cpp/test/fake_usb_device_info.h"
#include "services/device/public/mojom/usb_device.mojom.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace extensions {

namespace {

// ID of test USB device config to which interfaces described by
// |interface_classes| parameter of |CreateTestUsbDevice| should be added.
const int kUsbConfigWithInterfaces =;

// ID of test USB device config created by |CreateTestUsbDevice| that contains
// no interfaces.
const int kUsbConfigWithoutInterfaces =;

scoped_refptr<device::FakeUsbDeviceInfo> CreateTestUsbDevice(
    uint16_t vendor_id,
    uint16_t product_id,
    uint8_t device_class,
    const std::vector<uint8_t> interface_classes) {}

scoped_refptr<const Extension> CreateTestApp(
    base::Value usb_device_permission) {}

}  // namespace

TEST(USBDevicePermissionTest, PermissionDataOrder) {}

TEST(USBDevicePermissionTest, CheckVendorAndProductId) {}

TEST(USBDevicePermissionTest, CheckInterfaceId) {}

TEST(USBDevicePermissionTest, InterfaceClass) {}

TEST(USBDevicePermissionTest, InterfaceClassWithVendorId) {}

TEST(USBDevicePermissionTest, CheckHidUsbAgainstInterfaceClass) {}

TEST(USBDevicePermissionTest, CheckHidUsbAgainstDeviceIds) {}

TEST(USBDevicePermissionTest, CheckDeviceAgainstDeviceIds) {}

TEST(USBDevicePermissionTest, CheckDeviceAgainstDeviceClass) {}

TEST(USBDevicePermissionTest, IgnoreNullDeviceClass) {}

TEST(USBDevicePermissionTest, CheckDeviceAgainstInterfaceClass) {}

TEST(USBDevicePermissionTest, CheckDeviceAndInterfaceId) {}

TEST(USBDevicePermissionTest,
     CheckDeviceAndInterfaceIDAgainstMissingInterfaceId) {}

TEST(USBDevicePermissionTest, InvalidPermission_NoVendorId) {}

TEST(USBDevicePermissionTest, InvalidPermission_OnlyVendorId) {}

TEST(USBDevicePermissionTest, InvalidPermission_NoProductIdWithInterfaceId) {}

TEST(USBDevicePermissionTest, RejectInterfaceIdIfInterfaceClassPresent) {}

}  // namespace extensions