#include "net/test/embedded_test_server/controllable_http_response.h"
#include "base/check_op.h"
#include "base/functional/bind.h"
#include "base/strings/stringprintf.h"
#include "base/task/single_thread_task_runner.h"
#include "net/base/tracing.h"
#include "net/test/embedded_test_server/http_response.h"
namespace net::test_server {
class ControllableHttpResponse::Interceptor : public HttpResponse { … };
ControllableHttpResponse::ControllableHttpResponse(
EmbeddedTestServer* embedded_test_server,
const std::string& relative_url,
bool relative_url_is_prefix) { … }
ControllableHttpResponse::~ControllableHttpResponse() = default;
void ControllableHttpResponse::WaitForRequest() { … }
void ControllableHttpResponse::Send(
net::HttpStatusCode http_status,
const std::string& content_type,
const std::string& content,
const std::vector<std::string>& cookies,
const std::vector<std::string>& extra_headers) { … }
void ControllableHttpResponse::Send(const std::string& bytes) { … }
void ControllableHttpResponse::Done() { … }
bool ControllableHttpResponse::has_received_request() { … }
void ControllableHttpResponse::OnRequest(
scoped_refptr<base::SingleThreadTaskRunner>
embedded_test_server_task_runner,
base::WeakPtr<HttpResponseDelegate> delegate,
std::unique_ptr<HttpRequest> http_request) { … }
std::unique_ptr<HttpResponse> ControllableHttpResponse::RequestHandler(
base::WeakPtr<ControllableHttpResponse> controller,
scoped_refptr<base::SingleThreadTaskRunner> controller_task_runner,
bool* available,
const std::string& relative_url,
bool relative_url_is_prefix,
const HttpRequest& request) { … }
}