chromium/chrome/browser/enterprise/connectors/device_trust/attestation/browser/device_attester_unittest.cc

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

#include "chrome/browser/enterprise/connectors/device_trust/attestation/browser/device_attester.h"

#include "base/memory/scoped_refptr.h"
#include "base/run_loop.h"
#include "base/test/task_environment.h"
#include "base/test/test_future.h"
#include "chrome/browser/enterprise/connectors/device_trust/key_management/browser/mock_device_trust_key_manager.h"
#include "chrome/browser/enterprise/connectors/device_trust/key_management/core/persistence/scoped_key_persistence_delegate_factory.h"
#include "components/enterprise/browser/controller/fake_browser_dm_token_storage.h"
#include "components/policy/core/common/cloud/mock_cloud_policy_store.h"
#include "testing/gtest/include/gtest/gtest.h"

_;
Invoke;

namespace enterprise_connectors {

namespace {

constexpr char kFakeDeviceId[] =;
constexpr char kDmToken[] =;
constexpr char kInvalidDmToken[] =;
constexpr char kFakeCustomerId[] =;
constexpr char kFakeChallengeResponse[] =;

}  // namespace

class DeviceAttesterTest : public testing::Test {};

// Tests that the correct device details are added when the device attester
// builds the key info.
TEST_F(DeviceAttesterTest, DecorateKeyInfo_Success) {}

// Tests that the correct device details are added when the device attester
// attempts to build the key info with an invalid DM token.
TEST_F(DeviceAttesterTest, DecorateKeyInfo_InvalidDmToken) {}

// Tests that the correct device details are added when the device attester
// attempts to build the key info with an empty DM token.
TEST_F(DeviceAttesterTest, DecorateKeyInfo_EmptyDmToken) {}

// Tests that the correct device details are added when the device ID details
// are missing.
TEST_F(DeviceAttesterTest, DecorateKeyInfo_MissingDeviceID) {}

// Tests that the correct device details are added when the customer ID details
// are missing.
TEST_F(DeviceAttesterTest, DecorateKeyInfo_NoBrowserCustomerId) {}

// Tests that the correct device details are added when a failure occurred
// exporting the public key.
TEST_F(DeviceAttesterTest, DecorateKeyInfo_FailedPublicKeyExport) {}

// Tests that the correct device details are added when a failure occurred
// exporting the public key.
TEST_F(DeviceAttesterTest, DecorateKeyInfo_MissingBrowserPolicyLevel) {}

// Tests that no policy data is added when the browser cloud policy store is
// null.
TEST_F(DeviceAttesterTest, DecorateKeyInfo_MissingBrowserCloudPolicyStore) {}

// Tests when a browser level signature is added to the signed data.
TEST_F(DeviceAttesterTest, SignResponse_Success) {}

// Tests when no browser level signature is added to the signed data.
TEST_F(DeviceAttesterTest, SignResponse_NoSignature) {}

// Tests that no browser level signature is added to the signed data when the
// browser level is not in the policy level set.
TEST_F(DeviceAttesterTest, SignResponse_MissingBrowserPolicyLevel) {}

}  // namespace enterprise_connectors