#include "components/policy/test_support/embedded_policy_test_server_test_base.h"
#include <utility>
#include "base/check.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/run_loop.h"
#include "components/policy/core/common/cloud/cloud_policy_constants.h"
#include "net/base/url_util.h"
#include "net/http/http_request_headers.h"
#include "net/traffic_annotation/network_traffic_annotation_test_helper.h"
#include "services/network/public/cpp/resource_request.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
#include "services/network/public/cpp/simple_url_loader.h"
#include "services/network/public/mojom/url_response_head.mojom.h"
#include "services/network/test/test_shared_url_loader_factory.h"
DeviceManagementResponse;
namespace policy {
EmbeddedPolicyTestServerTestBase::EmbeddedPolicyTestServerTestBase()
: … { … }
EmbeddedPolicyTestServerTestBase::~EmbeddedPolicyTestServerTestBase() = default;
void EmbeddedPolicyTestServerTestBase::SetUp() { … }
void EmbeddedPolicyTestServerTestBase::AddQueryParam(const std::string& key,
const std::string& value) { … }
void EmbeddedPolicyTestServerTestBase::SetURL(const GURL& url) { … }
void EmbeddedPolicyTestServerTestBase::SetMethod(const std::string& method) { … }
void EmbeddedPolicyTestServerTestBase::SetAppType(const std::string& app_type) { … }
void EmbeddedPolicyTestServerTestBase::SetDeviceIdParam(
const std::string& device_id) { … }
void EmbeddedPolicyTestServerTestBase::SetDeviceType(
const std::string& device_type) { … }
void EmbeddedPolicyTestServerTestBase::SetOAuthToken(
const std::string& oauth_token) { … }
void EmbeddedPolicyTestServerTestBase::SetRequestTypeParam(
const std::string& request_type) { … }
void EmbeddedPolicyTestServerTestBase::SetEnrollmentTokenHeader(
const std::string& enrollment_token) { … }
void EmbeddedPolicyTestServerTestBase::SetDeviceTokenHeader(
const std::string& device_token) { … }
void EmbeddedPolicyTestServerTestBase::SetGoogleLoginTokenHeader(
const std::string& user_email) { … }
void EmbeddedPolicyTestServerTestBase::SetPayload(
const enterprise_management::DeviceManagementRequest&
device_management_request) { … }
void EmbeddedPolicyTestServerTestBase::StartRequestAndWait() { … }
void EmbeddedPolicyTestServerTestBase::DownloadedToString(
base::OnceClosure callback,
std::unique_ptr<std::string> response_body) { … }
int EmbeddedPolicyTestServerTestBase::GetResponseCode() const { … }
bool EmbeddedPolicyTestServerTestBase::HasResponseBody() const { … }
std::string EmbeddedPolicyTestServerTestBase::GetResponseBody() const { … }
DeviceManagementResponse
EmbeddedPolicyTestServerTestBase::GetDeviceManagementResponse() const { … }
}