chromium/device/fido/ble_adapter_manager_unittest.cc

// Copyright 2018 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/fido/ble_adapter_manager.h"

#include <memory>
#include <string>
#include <string_view>
#include <utility>

#include "base/functional/callback.h"
#include "base/memory/scoped_refptr.h"
#include "base/run_loop.h"
#include "base/test/gmock_callback_support.h"
#include "base/test/task_environment.h"
#include "base/test/test_future.h"
#include "device/bluetooth/bluetooth_adapter.h"
#include "device/bluetooth/bluetooth_adapter_factory.h"
#include "device/bluetooth/test/mock_bluetooth_adapter.h"
#include "device/bluetooth/test/mock_bluetooth_device.h"
#include "device/fido/fake_fido_discovery.h"
#include "device/fido/fido_authenticator.h"
#include "device/fido/fido_request_handler_base.h"
#include "device/fido/fido_transport_protocol.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace device {

namespace {

RunOnceClosure;
_;
BleStatus;

constexpr char kTestBluetoothDeviceAddress[] =;
constexpr char kTestBluetoothDisplayName[] =;

class MockObserver : public FidoRequestHandlerBase::Observer {};

class FakeFidoRequestHandlerBase : public FidoRequestHandlerBase {};

}  // namespace

class FidoBleAdapterManagerTest : public ::testing::Test {};

TEST_F(FidoBleAdapterManagerTest, AdapterNotPresent) {}

TEST_F(FidoBleAdapterManagerTest, AdapaterPresentAndPowered) {}

TEST_F(FidoBleAdapterManagerTest, AdapaterPresentAndCanBePowered) {}

TEST_F(FidoBleAdapterManagerTest, AdapaterPresentButChromeDisallowed) {}

TEST_F(FidoBleAdapterManagerTest, AdapaterPresentButPermissionUndetermined) {}

TEST_F(FidoBleAdapterManagerTest, SetBluetoothPowerOn) {}

TEST_F(FidoBleAdapterManagerTest, RequestBluetoothPermissionAllowed) {}

TEST_F(FidoBleAdapterManagerTest, RequestBluetoothPermissionDenied) {}

// Tests that if the Bluetooth API happens to report the OS permission status as
// "undetermined" after requesting permissions, the adapter manager reports is
// as available to let Chrome at least try to use it.
TEST_F(FidoBleAdapterManagerTest,
       RequestBluetoothPermissionHandlesUndetermined) {}

}  // namespace device