#include "chrome/browser/enterprise/connectors/device_trust/attestation/browser/browser_attestation_service.h"
#include "base/base64.h"
#include "base/command_line.h"
#include "base/json/json_reader.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/browser/attestation_switches.h"
#include "chrome/browser/enterprise/connectors/device_trust/attestation/common/attestation_utils.h"
#include "chrome/browser/enterprise/connectors/device_trust/attestation/common/proto/device_trust_attestation_ca.pb.h"
#include "components/device_signals/core/common/signals_constants.h"
#include "content/public/test/browser_task_environment.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
_;
Invoke;
StrictMock;
namespace enterprise_connectors {
namespace {
class MockAttester : public Attester { … };
constexpr char kEncodedChallenge[] = …;
constexpr char kEncodedChallengeNotFromVA[] = …;
constexpr char kEncodedChallengeDev[] = …;
constexpr char kDisplayName[] = …;
constexpr char kFakeSignature[] = …;
std::string GetSerializedSignedChallenge(bool use_dev = false) { … }
std::optional<SignedData> ParseDataFromResponse(const std::string& response) { … }
}
class BrowserAttestationServiceTest : public testing::Test { … };
TEST_F(BrowserAttestationServiceTest, BuildChallengeResponseDev_Success) { … }
TEST_F(BrowserAttestationServiceTest, BuildChallengeResponseProd_Success) { … }
TEST_F(BrowserAttestationServiceTest, BuildChallengeResponse_EmptyChallenge) { … }
TEST_F(BrowserAttestationServiceTest,
BuildChallengeResponse_BadChallengeSource) { … }
TEST_F(BrowserAttestationServiceTest, BuildChallengeResponse_BrowserOnly) { … }
TEST_F(BrowserAttestationServiceTest,
BuildChallengeResponse_BrowserOnly_MissingSignature) { … }
TEST_F(BrowserAttestationServiceTest, BuildChallengeResponse_ProfileOnly) { … }
TEST_F(BrowserAttestationServiceTest,
BuildChallengeResponse_EmptyPolicyLevels) { … }
}