chromium/components/policy/test_support/test_server_helpers.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 "components/policy/test_support/test_server_helpers.h"

#include <ranges>
#include <utility>

#include "base/ranges/algorithm.h"
#include "components/policy/core/common/cloud/cloud_policy_constants.h"
#include "net/base/url_util.h"
#include "net/http/http_status_code.h"
#include "net/test/embedded_test_server/http_request.h"
#include "net/test/embedded_test_server/http_response.h"
#include "third_party/re2/src/re2/re2.h"

namespace policy {

BasicHttpResponse;
HttpRequest;
HttpResponse;

namespace {

// C++ does not offer a mechanism to check if a given status code is present in
// net::HttpStatusCode enum. To allow distinguishing standard HTTP status code
// from custom ones, we define this array that will contain all standard codes.
constexpr net::HttpStatusCode kStandardHttpStatusCodes[] =;

}  // namespace

void CustomHttpResponse::SendResponse(
    base::WeakPtr<net::test_server::HttpResponseDelegate> delegate) {}

std::string KeyValueFromUrl(GURL url, const std::string& key) {}

bool MeetsServerSideRequirements(GURL url) {}

bool GetTokenFromAuthorization(const HttpRequest& request,
                               const std::string& token_header_prefix,
                               std::string* out) {}

bool GetEnrollmentTokenFromRequest(const HttpRequest& request,
                                   std::string* out) {}

bool GetDeviceTokenFromRequest(const HttpRequest& request, std::string* out) {}

bool GetGoogleLoginFromRequest(const net::test_server::HttpRequest& request,
                               std::string* out) {}

std::unique_ptr<HttpResponse> CreateHttpResponse(net::HttpStatusCode code,
                                                 const std::string& content) {}

}  // namespace policy