#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() { … }
constexpr char kJsonChallenge[] = …;
constexpr char kAttestationResponse[] = …;
constexpr char kResultHistogramName[] = …;
std::string GetSerializedSignedChallenge(const std::string& response) { … }
}
namespace enterprise_connectors {
MockAttestationService;
MockSignalsService;
class DeviceTrustServiceTest : public testing::Test,
public ::testing::WithParamInterface<bool> { … };
TEST_P(DeviceTrustServiceTest, IsEnabled) { … }
TEST_P(DeviceTrustServiceTest, BuildChallengeResponse) { … }
TEST_P(DeviceTrustServiceTest, AttestationFailure) { … }
TEST_P(DeviceTrustServiceTest, EmptyJson) { … }
TEST_P(DeviceTrustServiceTest, JsonMissingChallenge) { … }
TEST_P(DeviceTrustServiceTest, JsonInvalidEncode) { … }
INSTANTIATE_TEST_SUITE_P(…);
}