#include "net/test/url_request/url_request_mock_http_job.h"
#include <string_view>
#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/thread_pool.h"
#include "base/threading/thread_restrictions.h"
#include "net/base/filename_util.h"
#include "net/base/net_errors.h"
#include "net/base/url_util.h"
#include "net/http/http_response_headers.h"
#include "net/url_request/url_request_filter.h"
#include "net/url_request/url_request_interceptor.h"
namespace net {
namespace {
const char kMockHostname[] = …;
const base::FilePath::CharType kMockHeaderFileSuffix[] = …);
class MockJobInterceptor : public URLRequestInterceptor { … };
std::string DoFileIO(const base::FilePath& file_path) { … }
GURL GetMockUrlForScheme(const std::string& path, const std::string& scheme) { … }
}
void URLRequestMockHTTPJob::AddUrlHandlers(const base::FilePath& base_path) { … }
GURL URLRequestMockHTTPJob::GetMockUrl(const std::string& path) { … }
GURL URLRequestMockHTTPJob::GetMockHttpsUrl(const std::string& path) { … }
std::unique_ptr<URLRequestInterceptor> URLRequestMockHTTPJob::CreateInterceptor(
const base::FilePath& base_path) { … }
std::unique_ptr<URLRequestInterceptor>
URLRequestMockHTTPJob::CreateInterceptorForSingleFile(
const base::FilePath& file) { … }
URLRequestMockHTTPJob::URLRequestMockHTTPJob(URLRequest* request,
const base::FilePath& file_path)
: … { … }
URLRequestMockHTTPJob::~URLRequestMockHTTPJob() = default;
void URLRequestMockHTTPJob::GetResponseInfo(HttpResponseInfo* info) { … }
bool URLRequestMockHTTPJob::IsRedirectResponse(
GURL* location,
int* http_status_code,
bool* insecure_scheme_was_upgraded) { … }
void URLRequestMockHTTPJob::OnReadComplete(net::IOBuffer* buffer, int result) { … }
void URLRequestMockHTTPJob::Start() { … }
void URLRequestMockHTTPJob::SetHeadersAndStart(const std::string& raw_headers) { … }
void URLRequestMockHTTPJob::GetResponseInfoConst(HttpResponseInfo* info) const { … }
int64_t URLRequestMockHTTPJob::GetTotalReceivedBytes() const { … }
bool URLRequestMockHTTPJob::GetMimeType(std::string* mime_type) const { … }
bool URLRequestMockHTTPJob::GetCharset(std::string* charset) { … }
}