#include "services/network/test/mock_devtools_observer.h"
#include "base/run_loop.h"
#include "net/cookies/canonical_cookie.h"
#include "services/network/public/mojom/client_security_state.mojom.h"
#include "services/network/public/mojom/http_raw_headers.mojom.h"
#include "services/network/public/mojom/url_response_head.mojom.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace network {
MockDevToolsObserver::MockDevToolsObserver() = default;
MockDevToolsObserver::~MockDevToolsObserver() = default;
mojo::PendingRemote<mojom::DevToolsObserver> MockDevToolsObserver::Bind() { … }
void MockDevToolsObserver::OnRawRequest(
const std::string& devtools_request_id,
const net::CookieAccessResultList& cookies_with_access_result,
std::vector<network::mojom::HttpRawHeaderPairPtr> headers,
const base::TimeTicks timestamp,
network::mojom::ClientSecurityStatePtr client_security_state,
network::mojom::OtherPartitionInfoPtr site_has_cookie_in_other_partition) { … }
void MockDevToolsObserver::OnEarlyHintsResponse(
const std::string& devtools_request_id,
std::vector<network::mojom::HttpRawHeaderPairPtr> headers) { … }
void MockDevToolsObserver::OnRawResponse(
const std::string& devtools_request_id,
const net::CookieAndLineAccessResultList& cookies_with_access_result,
std::vector<network::mojom::HttpRawHeaderPairPtr> headers,
const std::optional<std::string>& raw_response_headers,
network::mojom::IPAddressSpace resource_address_space,
int32_t http_status_code,
const std::optional<net::CookiePartitionKey>& cookie_partition_key) { … }
void MockDevToolsObserver::OnPrivateNetworkRequest(
const std::optional<std::string>& devtools_request_id,
const GURL& url,
bool is_warning,
network::mojom::IPAddressSpace resource_address_space,
network::mojom::ClientSecurityStatePtr client_security_state) { … }
void MockDevToolsObserver::OnCorsPreflightRequest(
const base::UnguessableToken& devtool_request_id,
const net::HttpRequestHeaders& request_headers,
network::mojom::URLRequestDevToolsInfoPtr request_info,
const GURL& initiator_url,
const std::string& initiator_devtool_request_id) { … }
void MockDevToolsObserver::OnCorsPreflightResponse(
const base::UnguessableToken& devtool_request_id,
const GURL& url,
network::mojom::URLResponseHeadDevToolsInfoPtr head) { … }
void MockDevToolsObserver::OnCorsPreflightRequestCompleted(
const base::UnguessableToken& devtool_request_id,
const network::URLLoaderCompletionStatus& status) { … }
void MockDevToolsObserver::OnTrustTokenOperationDone(
const std::string& devtool_request_id,
network::mojom::TrustTokenOperationResultPtr result) { … }
void MockDevToolsObserver::OnCorsError(
const std::optional<std::string>& devtools_request_id,
const std::optional<::url::Origin>& initiator_origin,
mojom::ClientSecurityStatePtr client_security_state,
const GURL& url,
const network::CorsErrorStatus& status,
bool is_warning) { … }
void MockDevToolsObserver::Clone(
mojo::PendingReceiver<DevToolsObserver> observer) { … }
void MockDevToolsObserver::WaitUntilRawResponse(size_t goal) { … }
void MockDevToolsObserver::WaitUntilRawRequest(size_t goal) { … }
void MockDevToolsObserver::WaitUntilPrivateNetworkRequest() { … }
void MockDevToolsObserver::WaitUntilCorsError() { … }
void MockDevToolsObserver::WaitUntilEarlyHints() { … }
MockDevToolsObserver::OnPrivateNetworkRequestParams::
OnPrivateNetworkRequestParams(
const std::optional<std::string>& devtools_request_id,
const GURL& url,
bool is_warning,
network::mojom::IPAddressSpace resource_address_space,
network::mojom::ClientSecurityStatePtr client_security_state)
: … { … }
MockDevToolsObserver::OnPrivateNetworkRequestParams::
OnPrivateNetworkRequestParams(OnPrivateNetworkRequestParams&&) = default;
MockDevToolsObserver::OnPrivateNetworkRequestParams::
~OnPrivateNetworkRequestParams() = default;
MockDevToolsObserver::OnCorsErrorParams::OnCorsErrorParams() = default;
MockDevToolsObserver::OnCorsErrorParams::OnCorsErrorParams(
OnCorsErrorParams&&) = default;
MockDevToolsObserver::OnCorsErrorParams&
MockDevToolsObserver::OnCorsErrorParams::operator=(OnCorsErrorParams&&) =
default;
MockDevToolsObserver::OnCorsErrorParams::~OnCorsErrorParams() = default;
}