chromium/chrome/browser/enterprise/connectors/device_trust/device_trust_service_unittest.cc

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

#include <tuple>

#include "base/barrier_closure.h"
#include "base/base64.h"
#include "base/json/json_reader.h"
#include "base/memory/raw_ptr.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/task_environment.h"
#include "base/test/test_future.h"
#include "base/values.h"
#include "chrome/browser/enterprise/connectors/device_trust/attestation/common/mock_attestation_service.h"
#include "chrome/browser/enterprise/connectors/device_trust/common/common_types.h"
#include "chrome/browser/enterprise/connectors/device_trust/device_trust_connector_service.h"
#include "chrome/browser/enterprise/connectors/device_trust/signals/mock_signals_service.h"
#include "components/device_signals/core/common/signals_constants.h"
#include "components/enterprise/device_trust/prefs.h"
#include "components/prefs/testing_pref_service.h"
#include "services/data_decoder/public/cpp/test_support/in_process_data_decoder.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

_;
Invoke;
NotNull;

namespace {

base::Value::List GetOrigins() {}

// A sample VerifiedAccess v2 challenge rerepsented as a JSON string.
constexpr char kJsonChallenge[] =;

constexpr char kAttestationResponse[] =;

constexpr char kResultHistogramName[] =;

std::string GetSerializedSignedChallenge(const std::string& response) {}

}  // namespace

namespace enterprise_connectors {

MockAttestationService;
MockSignalsService;

class DeviceTrustServiceTest : public testing::Test,
                               public ::testing::WithParamInterface<bool> {};

// Tests that IsEnabled returns true only when the policy has some URLs.
TEST_P(DeviceTrustServiceTest, IsEnabled) {}

// Tests that the service kicks off the attestation flow properly.
TEST_P(DeviceTrustServiceTest, BuildChallengeResponse) {}

TEST_P(DeviceTrustServiceTest, AttestationFailure) {}

TEST_P(DeviceTrustServiceTest, EmptyJson) {}

TEST_P(DeviceTrustServiceTest, JsonMissingChallenge) {}

TEST_P(DeviceTrustServiceTest, JsonInvalidEncode) {}

INSTANTIATE_TEST_SUITE_P();

}  // namespace enterprise_connectors