#include "net/test/spawned_test_server/base_test_server.h"
#include <stdint.h>
#include <limits>
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include "base/base64.h"
#include "base/files/file_util.h"
#include "base/json/json_reader.h"
#include "base/logging.h"
#include "base/notreached.h"
#include "base/path_service.h"
#include "base/strings/string_util.h"
#include "base/values.h"
#include "net/base/address_list.h"
#include "net/base/host_port_pair.h"
#include "net/base/net_errors.h"
#include "net/base/network_isolation_key.h"
#include "net/base/port_util.h"
#include "net/cert/x509_certificate.h"
#include "net/dns/public/dns_query_type.h"
#include "net/log/net_log_with_source.h"
#include "net/test/cert_test_util.h"
#include "net/test/test_data_directory.h"
#include "url/gurl.h"
namespace net {
namespace {
std::string GetHostname(BaseTestServer::Type type,
const BaseTestServer::SSLOptions& options) { … }
bool GetLocalCertificatesDir(const base::FilePath& certificates_dir,
base::FilePath* local_certificates_dir) { … }
}
BaseTestServer::SSLOptions::SSLOptions() = default;
BaseTestServer::SSLOptions::SSLOptions(ServerCertificate cert)
: … { … }
BaseTestServer::SSLOptions::SSLOptions(base::FilePath cert)
: … { … }
BaseTestServer::SSLOptions::SSLOptions(const SSLOptions& other) = default;
BaseTestServer::SSLOptions::~SSLOptions() = default;
base::FilePath BaseTestServer::SSLOptions::GetCertificateFile() const { … }
BaseTestServer::BaseTestServer(Type type) : … { … }
BaseTestServer::BaseTestServer(Type type, const SSLOptions& ssl_options)
: … { … }
BaseTestServer::~BaseTestServer() = default;
bool BaseTestServer::Start() { … }
const HostPortPair& BaseTestServer::host_port_pair() const { … }
std::string BaseTestServer::GetScheme() const { … }
bool BaseTestServer::GetAddressList(AddressList* address_list) const { … }
uint16_t BaseTestServer::GetPort() { … }
void BaseTestServer::SetPort(uint16_t port) { … }
GURL BaseTestServer::GetURL(const std::string& path) const { … }
GURL BaseTestServer::GetURL(const std::string& hostname,
const std::string& relative_url) const { … }
GURL BaseTestServer::GetURLWithUser(const std::string& path,
const std::string& user) const { … }
GURL BaseTestServer::GetURLWithUserAndPassword(const std::string& path,
const std::string& user,
const std::string& password) const { … }
bool BaseTestServer::GetFilePathWithReplacements(
const std::string& original_file_path,
const std::vector<StringPair>& text_to_replace,
std::string* replacement_path) { … }
ScopedTestRoot BaseTestServer::RegisterTestCerts() { … }
bool BaseTestServer::LoadTestRootCert() { … }
scoped_refptr<X509Certificate> BaseTestServer::GetCertificate() const { … }
void BaseTestServer::Init(const std::string& host) { … }
void BaseTestServer::SetResourcePath(const base::FilePath& document_root,
const base::FilePath& certificates_dir) { … }
bool BaseTestServer::SetAndParseServerData(const std::string& server_data,
int* port) { … }
bool BaseTestServer::SetupWhenServerStarted() { … }
void BaseTestServer::CleanUpWhenStoppingServer() { … }
std::optional<base::Value::Dict> BaseTestServer::GenerateArguments() const { … }
}