#include "remoting/base/protobuf_http_test_responder.h"
#include "base/containers/adapters.h"
#include "base/ranges/algorithm.h"
#include "base/run_loop.h"
#include "net/http/http_status_code.h"
#include "remoting/base/protobuf_http_client_messages.pb.h"
#include "remoting/base/protobuf_http_status.h"
#include "services/network/public/cpp/weak_wrapper_shared_url_loader_factory.h"
#include "third_party/protobuf/src/google/protobuf/message_lite.h"
namespace remoting {
namespace {
protobufhttpclient::Status ToProtobufStatus(const ProtobufHttpStatus& status) { … }
}
ProtobufHttpTestResponder::ProtobufHttpTestResponder() = default;
ProtobufHttpTestResponder::~ProtobufHttpTestResponder() = default;
bool ProtobufHttpTestResponder::ParseRequestMessage(
const network::ResourceRequest& resource_request,
google::protobuf::MessageLite* out_message) { … }
scoped_refptr<network::SharedURLLoaderFactory>
ProtobufHttpTestResponder::GetUrlLoaderFactory() { … }
void ProtobufHttpTestResponder::AddResponse(
const std::string& url,
const google::protobuf::MessageLite& response_message) { … }
void ProtobufHttpTestResponder::AddResponseToMostRecentRequestUrl(
const google::protobuf::MessageLite& response_message) { … }
void ProtobufHttpTestResponder::AddError(
const std::string& url,
const ProtobufHttpStatus& error_status) { … }
void ProtobufHttpTestResponder::AddErrorToMostRecentRequestUrl(
const ProtobufHttpStatus& error_status) { … }
void ProtobufHttpTestResponder::AddStreamResponse(
const std::string& url,
const std::vector<const google::protobuf::MessageLite*>& messages,
const ProtobufHttpStatus& status) { … }
void ProtobufHttpTestResponder::AddStreamResponseToMostRecentRequestUrl(
const std::vector<const google::protobuf::MessageLite*>& messages,
const ProtobufHttpStatus& status) { … }
bool ProtobufHttpTestResponder::GetRequestMessage(
const std::string& url,
google::protobuf::MessageLite* out_message) { … }
bool ProtobufHttpTestResponder::GetMostRecentRequestMessage(
google::protobuf::MessageLite* out_message) { … }
int ProtobufHttpTestResponder::GetNumPending() { … }
network::TestURLLoaderFactory::PendingRequest&
ProtobufHttpTestResponder::GetPendingRequest(size_t index) { … }
network::TestURLLoaderFactory::PendingRequest&
ProtobufHttpTestResponder::GetMostRecentPendingRequest() { … }
std::string ProtobufHttpTestResponder::GetMostRecentRequestUrl() { … }
ProtobufHttpTestResponder::MockInterceptor&
ProtobufHttpTestResponder::GetMockInterceptor() { … }
}