#include "chrome/browser/enterprise/connectors/device_trust/test/device_trust_browsertest_base.h"
#include <utility>
#include "chrome/browser/enterprise/connectors/device_trust/key_management/installer/metrics_util.h"
#include "chrome/browser/enterprise/connectors/device_trust/test/test_constants.h"
#include "chrome/browser/enterprise/connectors/test/test_constants.h"
#include "chrome/browser/ui/browser.h"
#include "content/public/test/browser_test_utils.h"
#include "net/dns/mock_host_resolver.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace enterprise_connectors::test {
namespace {
constexpr char kRedirectPath[] = …;
constexpr char kRedirectLocationPath[] = …;
constexpr char kDeviceTrustHeader[] = …;
constexpr char kDeviceTrustHeaderValue[] = …;
constexpr char kVerifiedAccessChallengeHeader[] = …;
constexpr char kVerifiedAccessResponseHeader[] = …;
constexpr char kFunnelHistogramName[] = …;
constexpr char kResultHistogramName[] = …;
constexpr char kLatencySuccessHistogramName[] = …;
constexpr char kLatencyFailureHistogramName[] = …;
constexpr char kAttestationPolicyLevelHistogramName[] = …;
constexpr char kKeyRotationStatusHistogramFormat[] = …;
constexpr char kWithNonceVariant[] = …;
constexpr char kNoNonceVariant[] = …;
constexpr char kChallenge[] = …;
}
DeviceTrustBrowserTestBase::DeviceTrustBrowserTestBase(
std::optional<DeviceTrustConnectorState> connector_state)
: … { … }
DeviceTrustBrowserTestBase::~DeviceTrustBrowserTestBase() = default;
void DeviceTrustBrowserTestBase::SetUpInProcessBrowserTestFixture() { … }
void DeviceTrustBrowserTestBase::TearDownOnMainThread() { … }
void DeviceTrustBrowserTestBase::SetChallengeValue(
const std::string& new_challenge_value) { … }
GURL DeviceTrustBrowserTestBase::GetRedirectUrl() { … }
GURL DeviceTrustBrowserTestBase::GetRedirectLocationUrl() { … }
GURL DeviceTrustBrowserTestBase::GetDisallowedUrl() { … }
void DeviceTrustBrowserTestBase::TriggerUrlNavigation(std::optional<GURL> url) { … }
void DeviceTrustBrowserTestBase::ExpectFunnelStep(
DTAttestationFunnelStep step) { … }
std::string DeviceTrustBrowserTestBase::GetChallengeResponseHeader() { … }
void DeviceTrustBrowserTestBase::VerifyAttestationFlowSuccessful(
DTAttestationResult success_result,
std::optional<DTAttestationPolicyLevel> policy_level) { … }
void DeviceTrustBrowserTestBase::VerifyAttestationFlowFailure(
const std::string& expected_challenge_response) { … }
void DeviceTrustBrowserTestBase::VerifyNoInlineFlowOccurred() { … }
void DeviceTrustBrowserTestBase::VerifyKeyRotationSuccess(bool with_nonce) { … }
content::WebContents* DeviceTrustBrowserTestBase::web_contents(
Browser* active_browser) { … }
std::unique_ptr<net::test_server::HttpResponse>
DeviceTrustBrowserTestBase::HandleRequest(
const net::test_server::HttpRequest& request) { … }
void DeviceTrustBrowserTestBase::ResetState() { … }
}