#include "services/network/url_loader.h"
#include <stdint.h>
#include <limits>
#include <list>
#include <memory>
#include <optional>
#include <string>
#include <utility>
#include <vector>
#include "base/auto_reset.h"
#include "base/files/file.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/ref_counted.h"
#include "base/memory/weak_ptr.h"
#include "base/no_destructor.h"
#include "base/path_service.h"
#include "base/run_loop.h"
#include "base/strings/escape.h"
#include "base/strings/strcat.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/bind.h"
#include "base/test/gtest_util.h"
#include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/task_environment.h"
#include "base/time/time.h"
#include "build/build_config.h"
#include "mojo/public/c/system/data_pipe.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "mojo/public/cpp/bindings/self_owned_receiver.h"
#include "mojo/public/cpp/system/data_pipe_utils.h"
#include "mojo/public/cpp/system/wait.h"
#include "net/base/completion_repeating_callback.h"
#include "net/base/features.h"
#include "net/base/io_buffer.h"
#include "net/base/ip_endpoint.h"
#include "net/base/isolation_info.h"
#include "net/base/load_flags.h"
#include "net/base/mime_sniffer.h"
#include "net/base/net_errors.h"
#include "net/base/transport_info.h"
#include "net/cert/test_root_certs.h"
#include "net/cookies/cookie_access_result.h"
#include "net/cookies/cookie_change_dispatcher.h"
#include "net/cookies/cookie_inclusion_status.h"
#include "net/cookies/cookie_partition_key.h"
#include "net/cookies/cookie_setting_override.h"
#include "net/cookies/cookie_util.h"
#include "net/dns/mock_host_resolver.h"
#include "net/http/http_network_session.h"
#include "net/http/http_response_info.h"
#include "net/http/http_status_code.h"
#include "net/http/http_transaction_test_util.h"
#include "net/log/net_log_event_type.h"
#include "net/log/test_net_log.h"
#include "net/proxy_resolution/configured_proxy_resolution_service.h"
#include "net/socket/socket_test_util.h"
#include "net/ssl/client_cert_identity_test_util.h"
#include "net/storage_access_api/status.h"
#include "net/test/cert_test_util.h"
#include "net/test/embedded_test_server/controllable_http_response.h"
#include "net/test/embedded_test_server/embedded_test_server.h"
#include "net/test/embedded_test_server/http_response.h"
#include "net/test/gtest_util.h"
#include "net/test/quic_simple_test_server.h"
#include "net/test/test_data_directory.h"
#include "net/test/url_request/url_request_failed_job.h"
#include "net/third_party/quiche/src/quiche/common/http/http_header_block.h"
#include "net/traffic_annotation/network_traffic_annotation_test_helper.h"
#include "net/url_request/url_request.h"
#include "net/url_request/url_request_context.h"
#include "net/url_request/url_request_context_builder.h"
#include "net/url_request/url_request_filter.h"
#include "net/url_request/url_request_interceptor.h"
#include "net/url_request/url_request_job.h"
#include "net/url_request/url_request_test_job.h"
#include "net/url_request/url_request_test_util.h"
#include "services/network/attribution/attribution_request_helper.h"
#include "services/network/public/cpp/cors/origin_access_list.h"
#include "services/network/public/cpp/features.h"
#include "services/network/public/cpp/ip_address_space_util.h"
#include "services/network/public/cpp/resource_request.h"
#include "services/network/public/mojom/cookie_access_observer.mojom-forward.h"
#include "services/network/public/mojom/cookie_access_observer.mojom.h"
#include "services/network/public/mojom/early_hints.mojom.h"
#include "services/network/public/mojom/http_raw_headers.mojom.h"
#include "services/network/public/mojom/ip_address_space.mojom-shared.h"
#include "services/network/public/mojom/ip_address_space.mojom.h"
#include "services/network/public/mojom/network_context.mojom.h"
#include "services/network/public/mojom/network_service.mojom.h"
#include "services/network/public/mojom/trust_tokens.mojom-shared.h"
#include "services/network/public/mojom/url_loader.mojom.h"
#include "services/network/resource_scheduler/resource_scheduler_client.h"
#include "services/network/shared_dictionary/shared_dictionary_access_checker.h"
#include "services/network/shared_storage/shared_storage_header_utils.h"
#include "services/network/shared_storage/shared_storage_request_helper.h"
#include "services/network/shared_storage/shared_storage_test_url_loader_network_observer.h"
#include "services/network/shared_storage/shared_storage_test_utils.h"
#include "services/network/test/mock_devtools_observer.h"
#include "services/network/test/test_data_pipe_getter.h"
#include "services/network/test/test_network_context_client.h"
#include "services/network/test/test_url_loader_client.h"
#include "services/network/test/test_url_loader_network_observer.h"
#include "services/network/test/url_loader_context_for_tests.h"
#include "services/network/test_chunked_data_pipe_getter.h"
#include "services/network/trust_tokens/trust_token_key_commitment_getter.h"
#include "services/network/trust_tokens/trust_token_request_helper.h"
#include "services/network/trust_tokens/trust_token_request_helper_factory.h"
#include "services/network/url_request_context_owner.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"
namespace network {
namespace {
IsError;
IsOk;
ElementsAre;
Eq;
Optional;
Pointee;
SizeIs;
ValuesIn;
URLLoader::DeleteCallback DeleteLoaderCallback(
base::RunLoop* run_loop,
std::unique_ptr<URLLoader>* url_loader) { … }
URLLoader::DeleteCallback NeverInvokedDeleteLoaderCallback() { … }
constexpr char kTestAuthURL[] = …;
constexpr char kInsecureHost[] = …;
constexpr char kHostnameWithAliases[] = …;
constexpr char kHostnameWithoutAliases[] = …;
static ResourceRequest CreateResourceRequest(const char* method,
const GURL& url) { … }
class URLRequestMultipleWritesJob : public net::URLRequestJob { … };
class MultipleWritesInterceptor : public net::URLRequestInterceptor { … };
class URLRequestEternalSyncReadsJob : public net::URLRequestJob { … };
class EternalSyncReadsInterceptor : public net::URLRequestInterceptor { … };
class URLRequestSimulatedCacheJob : public net::URLRequestJob { … };
class SimulatedCacheInterceptor : public net::URLRequestInterceptor { … };
class ResultObserver { … };
class URLRequestFakeTransportInfoJob : public net::URLRequestJob { … };
class FakeTransportInfoInterceptor : public net::URLRequestInterceptor { … };
mojom::ClientSecurityStatePtr NewSecurityState() { … }
CorsErrorStatus InsecurePrivateNetworkCorsErrorStatus(
mojom::IPAddressSpace resource_address_space) { … }
std::string CookieOrLineToString(const mojom::CookieOrLinePtr& cookie_or_line) { … }
MATCHER_P2(CookieOrLine, string, type, "") { … }
struct URLLoaderOptions { … };
}
class MockAcceptCHFrameObserver : public mojom::AcceptCHFrameObserver { … };
class URLLoaderTest : public testing::Test { … };
class URLLoaderMockSocketTest : public URLLoaderTest { … };
constexpr int URLLoaderTest::kProcessId;
constexpr int URLLoaderTest::kRouteId;
TEST_F(URLLoaderTest, Basic) { … }
TEST_F(URLLoaderTest, Empty) { … }
TEST_F(URLLoaderTest, BasicSSL) { … }
TEST_F(URLLoaderTest, SSLSentOnlyWhenRequested) { … }
TEST_F(URLLoaderTest, PotentiallyTrustworthySameOriginIsOk) { … }
TEST_F(URLLoaderTest, MissingClientSecurityStateIsOk) { … }
TEST_F(URLLoaderTest, MatchingTargetIPAddressSpaceIsOk) { … }
TEST_F(URLLoaderTest, MismatchingTargetIPAddressSpaceWarnIsNotBlocked) { … }
TEST_F(URLLoaderTest, MismatchingTargetIPAddressSpaceIsBlocked) { … }
TEST_F(URLLoaderTest, MismatchingTargetIPAddressSpaceErrorCode) { … }
TEST_F(URLLoaderTest, InconsistentIPAddressSpaceWarnIsNotBlocked) { … }
TEST_F(URLLoaderTest, InconsistentIPAddressSpaceIsBlocked) { … }
TEST_F(URLLoaderTest, SecureUnknownToLocalBlock) { … }
TEST_F(URLLoaderTest, SecureUnknownToLocalWarn) { … }
TEST_F(URLLoaderTest, SecureUnknownToLocalAllow) { … }
TEST_F(URLLoaderTest, SecureUnknownToLocalPreflightWarn) { … }
TEST_F(URLLoaderTest, SecureUnknownToLocalPreflightBlock) { … }
TEST_F(URLLoaderTest, NonSecureUnknownToLocalBlock) { … }
TEST_F(URLLoaderTest, NonSecureUnknownToLocalWarn) { … }
TEST_F(URLLoaderTest, NonSecureUnknownToLocalAllow) { … }
TEST_F(URLLoaderTest, NonSecureUnknownToLocalPreflightWarn) { … }
TEST_F(URLLoaderTest, NonSecureUnknownToLocalPreflightBlock) { … }
TEST_F(URLLoaderTest, SecurePublicToLocalBlock) { … }
TEST_F(URLLoaderTest, SecurePublicToLocalWarn) { … }
TEST_F(URLLoaderTest, SecurePublicToLocalAllow) { … }
TEST_F(URLLoaderTest, SecurePublicToLocalPreflightWarn) { … }
TEST_F(URLLoaderTest, SecurePublicToLocalPreflightBlock) { … }
TEST_F(URLLoaderTest, NonSecurePublicToLocalBlock) { … }
TEST_F(URLLoaderTest, NonSecurePublicToLocalWarn) { … }
TEST_F(URLLoaderTest, NonSecurePublicToLocalAllow) { … }
TEST_F(URLLoaderTest, NonSecurePublicToLocalPreflightWarn) { … }
TEST_F(URLLoaderTest, NonSecurePublicToLocalPreflightBlock) { … }
TEST_F(URLLoaderTest, SecurePrivateToLocalBlock) { … }
TEST_F(URLLoaderTest, SecurePrivateToLocalWarn) { … }
TEST_F(URLLoaderTest, SecurePrivateToLocalAllow) { … }
TEST_F(URLLoaderTest, SecurePrivateToLocalPreflightBlock) { … }
TEST_F(URLLoaderTest, SecurePrivateToLocalPreflightWarn) { … }
TEST_F(URLLoaderTest, NonSecurePrivateToLocalBlock) { … }
TEST_F(URLLoaderTest, NonSecurePrivateToLocalWarn) { … }
TEST_F(URLLoaderTest, NonSecurePrivateToLocalAllow) { … }
TEST_F(URLLoaderTest, NonSecurePrivateToLocalPreflightBlock) { … }
TEST_F(URLLoaderTest, NonSecurePrivateToLocalPreflightWarn) { … }
TEST_F(URLLoaderTest, SecureLocalToLocalBlock) { … }
TEST_F(URLLoaderTest, SecureLocalToLocalWarn) { … }
TEST_F(URLLoaderTest, SecureLocalToLocalAllow) { … }
TEST_F(URLLoaderTest, SecureLocalToLocalPreflightBlock) { … }
TEST_F(URLLoaderTest, SecureLocalToLocalPreflightWarn) { … }
TEST_F(URLLoaderTest, NonSecureLocalToLocalBlock) { … }
TEST_F(URLLoaderTest, NonSecureLocalToLocalWarn) { … }
TEST_F(URLLoaderTest, NonSecureLocalToLocalAllow) { … }
TEST_F(URLLoaderTest, NonSecureLocalToLocalPreflightBlock) { … }
TEST_F(URLLoaderTest, NonSecureLocalToLocalPreflightWarn) { … }
TEST_F(URLLoaderTest, AddsNetLogEntryForPrivateNetworkAccessCheckSuccess) { … }
TEST_F(URLLoaderTest, AddsNetLogEntryForPrivateNetworkAccessCheckFailure) { … }
TEST_F(URLLoaderTest, AddsNetLogEntryForPrivateNetworkAccessCheckSameOrigin) { … }
struct URLLoaderFakeTransportInfoTestParams { … };
std::ostream& operator<<(std::ostream& out,
const URLLoaderFakeTransportInfoTestParams& params) { … }
mojom::IPAddressSpace ResponseAddressSpace(
const URLLoaderFakeTransportInfoTestParams& params) { … }
class URLLoaderFakeTransportInfoTest
: public URLLoaderTest,
public testing::WithParamInterface<URLLoaderFakeTransportInfoTestParams> { … };
TEST_P(URLLoaderFakeTransportInfoTest, PrivateNetworkRequestLoadsCorrectly) { … }
constexpr URLLoaderFakeTransportInfoTestParams
kURLLoaderFakeTransportInfoTestParamsList[] = …;
INSTANTIATE_TEST_SUITE_P(…);
TEST_F(URLLoaderTest, AuthChallengeInfo) { … }
TEST_F(URLLoaderTest, NoAuthChallengeInfo) { … }
TEST_F(URLLoaderTest, GzipTest) { … }
TEST_F(URLLoaderTest, ErrorBeforeHeaders) { … }
TEST_F(URLLoaderTest, SyncErrorWhileReadingBody) { … }
TEST_F(URLLoaderTest, AsyncErrorWhileReadingBody) { … }
TEST_F(URLLoaderTest, SyncErrorWhileReadingBodyAfterBytesReceived) { … }
TEST_F(URLLoaderTest, AsyncErrorWhileReadingBodyAfterBytesReceived) { … }
TEST_F(URLLoaderTest, DoNotSniffUnlessSpecified) { … }
TEST_F(URLLoaderTest, SniffMimeType) { … }
TEST_F(URLLoaderTest, RespectNoSniff) { … }
TEST_F(URLLoaderTest, SniffTextPlainDoesNotResultInHTML) { … }
TEST_F(URLLoaderTest, DoNotSniffHTMLFromImageGIF) { … }
TEST_F(URLLoaderTest, EmptyHtmlIsTextPlain) { … }
TEST_F(URLLoaderTest, EmptyHtmlIsTextPlainWithAsyncResponse) { … }
TEST_F(URLLoaderTest, FirstReadNotEnoughToSniff1) { … }
TEST_F(URLLoaderTest, FirstReadNotEnoughToSniff2) { … }
TEST_F(URLLoaderTest, LoneReadNotEnoughToSniff) { … }
TEST_F(URLLoaderTest, FirstReadIsEnoughToSniff) { … }
class NeverFinishedBodyHttpResponse : public net::test_server::HttpResponse { … };
TEST_F(URLLoaderTest, DestroyOnURLLoaderPipeClosed) { … }
TEST_F(URLLoaderTest, CloseResponseBodyConsumerBeforeProducer) { … }
TEST_F(URLLoaderTest, PauseReadingBodyFromNetBeforeResponseHeaders) { … }
TEST_F(URLLoaderTest, PauseReadingBodyFromNetWhenReadIsPending) { … }
TEST_F(URLLoaderTest, ResumeReadingBodyFromNetAfterClosingConsumer) { … }
TEST_F(URLLoaderTest, MultiplePauseResumeReadingBodyFromNet) { … }
TEST_F(URLLoaderTest, UploadBytes) { … }
TEST_F(URLLoaderTest, UploadFile) { … }
TEST_F(URLLoaderTest, UploadFileWithRange) { … }
TEST_F(URLLoaderTest, UploadTwoFiles) { … }
TEST_F(URLLoaderTest, UploadTwoBatchesOfFiles) { … }
TEST_F(URLLoaderTest, UploadTwoBatchesOfFilesWithRespondInvalidFile) { … }
TEST_F(URLLoaderTest, UploadTwoBatchesOfFilesWithRespondDifferentNumOfFiles) { … }
TEST_F(URLLoaderTest, UploadInvalidFile) { … }
TEST_F(URLLoaderTest, UploadFileWithoutNetworkServiceClient) { … }
class CallbackSavingNetworkContextClient : public TestNetworkContextClient { … };
TEST_F(URLLoaderTest, UploadFileCanceled) { … }
TEST_F(URLLoaderTest, UploadDataPipe) { … }
TEST_F(URLLoaderTest, UploadDataPipe_Redirect307) { … }
TEST_F(URLLoaderTest, UploadDataPipeWithLotsOfData) { … }
TEST_F(URLLoaderTest, UploadDataPipeError) { … }
TEST_F(URLLoaderTest, UploadDataPipeClosedEarly) { … }
TEST_F(URLLoaderTest, UploadChunkedDataPipe) { … }
TEST_F(URLLoaderTest, UploadChunkedDataPipeOverHTTP2) { … }
TEST_F(URLLoaderTest, UploadChunkedDataPipeNotAllowHTTP1) { … }
TEST_F(URLLoaderTest, UploadChunkedDataPipeReadOnceStream) { … }
TEST_F(URLLoaderTest, NoSSLInfoWithoutCertificateError) { … }
TEST_F(URLLoaderTest, NoSSLInfoOnComplete) { … }
TEST_F(URLLoaderTest, SSLInfoOnComplete) { … }
TEST_F(URLLoaderTest, SSLInfoOnResponseWithCertificateError) { … }
TEST_F(URLLoaderTest, SSLInfoOnRedirectWithCertificateError) { … }
TEST_F(URLLoaderTest, RedirectModifiedHeaders) { … }
TEST_F(URLLoaderTest, RedirectFailsOnModifyUnsafeHeader) { … }
TEST_F(URLLoaderTest, RedirectRemoveHeader) { … }
TEST_F(URLLoaderTest, RedirectRemoveHeaderAndAddItBack) { … }
TEST_F(URLLoaderTest, UpgradeAddsSecHeaders) { … }
TEST_F(URLLoaderTest, DowngradeRemovesSecHeaders) { … }
TEST_F(URLLoaderTest, RedirectChainRemovesAndAddsSecHeaders) { … }
TEST_F(URLLoaderTest, RedirectSecHeadersUser) { … }
TEST_F(URLLoaderTest, RedirectDirectlyModifiedSecHeadersUser) { … }
class MockHTTPSURLRequestJob : public net::URLRequestTestJob { … };
class MockHTTPSJobURLRequestInterceptor : public net::URLRequestInterceptor { … };
TEST_F(URLLoaderTest, CertStatusOnResponse) { … }
#if BUILDFLAG(IS_MAC)
#define MAYBE_ResourceSchedulerIntegration …
#else
#define MAYBE_ResourceSchedulerIntegration …
#endif
TEST_F(URLLoaderTest, MAYBE_ResourceSchedulerIntegration) { … }
TEST_F(URLLoaderTest, ReadPipeClosedWhileReadTaskPosted) { … }
class FakeSSLPrivateKeyImpl : public network::mojom::SSLPrivateKey { … };
CookieAccessType;
class MockCookieObserver : public network::mojom::CookieAccessObserver { … };
MATCHER_P3(MatchesCookieDetails, type, cookie_or_line, is_include, "") { … }
class MockTrustTokenObserver : public network::mojom::TrustTokenAccessObserver { … };
MATCHER_P3(MatchesTrustTokenDetails, origin, issuer, blocked, "") { … }
class ClientCertAuthObserver : public TestURLLoaderNetworkObserver { … };
TEST_F(URLLoaderTest, SetAuth) { … }
TEST_F(URLLoaderTest, CancelAuth) { … }
TEST_F(URLLoaderTest, TwoChallenges) { … }
TEST_F(URLLoaderTest, NoAuthRequiredForFavicon) { … }
TEST_F(URLLoaderTest, HttpAuthResponseHeadersAvailable) { … }
TEST_F(URLLoaderTest, FollowRedirectTwice) { … }
class TestSSLPrivateKey : public net::SSLPrivateKey { … };
#if !BUILDFLAG(IS_IOS)
TEST_F(URLLoaderTest, ClientAuthRespondTwice) { … }
TEST_F(URLLoaderTest, ClientAuthDestroyResponder) { … }
TEST_F(URLLoaderTest, ClientAuthCancelConnection) { … }
TEST_F(URLLoaderTest, ClientAuthCancelCertificateSelection) { … }
TEST_F(URLLoaderTest, ClientAuthNoCertificate) { … }
TEST_F(URLLoaderTest, ClientAuthCertificateWithValidSignature) { … }
TEST_F(URLLoaderTest, ClientAuthCertificateWithInvalidSignature) { … }
TEST_F(URLLoaderTest, BlockAllCookies) { … }
TEST_F(URLLoaderTest, BlockOnlyThirdPartyCookies) { … }
TEST_F(URLLoaderTest, AllowAllCookies) { … }
class StorageAccessHeaderURLLoaderTest : public URLLoaderTest { … };
TEST_F(StorageAccessHeaderURLLoaderTest, StorageAccessHeader_Load_NoStatus) { … }
TEST_F(StorageAccessHeaderURLLoaderTest, StorageAccessHeader_Load_StatusNone) { … }
TEST_F(StorageAccessHeaderURLLoaderTest,
StorageAccessHeader_Load_StatusInactive) { … }
TEST_F(StorageAccessHeaderURLLoaderTest,
StorageAccessHeader_Load_StatusActive) { … }
TEST_F(StorageAccessHeaderURLLoaderTest, StorageAccessHeader_RedirectWithLoad) { … }
class URLLoaderCookieSettingOverridesTest
: public URLLoaderTest,
public ::testing::WithParamInterface<
std::tuple<bool, bool, net::StorageAccessApiStatus, bool>> { … };
TEST_P(URLLoaderCookieSettingOverridesTest, CookieSettingOverrides) { … }
TEST_P(URLLoaderCookieSettingOverridesTest,
CookieSettingOverrides_OnSameSiteRedirects) { … }
TEST_P(URLLoaderCookieSettingOverridesTest,
CookieSettingOverrides_OnCrossSiteRedirects) { … }
TEST_P(URLLoaderCookieSettingOverridesTest,
CookieSettingOverrides_OnCrossSiteToSameSite) { … }
INSTANTIATE_TEST_SUITE_P(…);
namespace {
enum class TestMode { … };
}
class URLLoaderParameterTest : public URLLoaderTest,
public ::testing::WithParamInterface<TestMode> { … };
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(URLLoaderParameterTest, CredentialsModeOmitRequireClientCert) { … }
TEST_P(URLLoaderParameterTest, CredentialsModeOmitOptionalClientCert) { … }
#endif
TEST_F(URLLoaderTest, CookieReporting) { … }
TEST_F(URLLoaderTest, CookieReportingRedirect) { … }
TEST_F(URLLoaderTest, CookieReportingAuth) { … }
TEST_F(URLLoaderTest, RawRequestCookies) { … }
TEST_F(URLLoaderTest, RawRequestCookiesFlagged) { … }
TEST_F(URLLoaderTest, RawResponseCookies) { … }
TEST_F(URLLoaderTest, RawResponseCookiesInvalid) { … }
TEST_F(URLLoaderTest, RawResponseCookiesRedirect) { … }
TEST_F(URLLoaderTest, RawResponseCookiesAuth) { … }
TEST_F(URLLoaderTest, RawResponseQUIC) { … }
TEST_F(URLLoaderTest, EarlyHints) { … }
TEST_F(URLLoaderTest, CookieReportingCategories) { … }
namespace {
enum class SyncOrAsync { … };
class MockTrustTokenRequestHelper : public TrustTokenRequestHelper { … };
class NoopTrustTokenKeyCommitmentGetter : public TrustTokenKeyCommitmentGetter { … };
base::NoDestructor<NoopTrustTokenKeyCommitmentGetter>
noop_key_commitment_getter{ … };
mojom::NetworkContextClient* ReturnNullNetworkContextClient() { … }
class MockTrustTokenRequestHelperFactory
: public TrustTokenRequestHelperFactory { … };
class MockTrustTokenDevToolsObserver : public MockDevToolsObserver { … };
class ExpectBypassCacheInterceptor : public net::URLRequestInterceptor { … };
class ExpectCookieSettingOverridesURLRequestInterceptor
: public net::URLRequestInterceptor { … };
}
class URLLoaderSyncOrAsyncTrustTokenOperationTest
: public URLLoaderTest,
public ::testing::WithParamInterface<SyncOrAsync> { … };
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(URLLoaderSyncOrAsyncTrustTokenOperationTest,
HandlesTrustTokenOperationSuccess) { … }
TEST_P(URLLoaderSyncOrAsyncTrustTokenOperationTest,
HandlesTrustTokenRedemptionRecordCacheHit) { … }
TEST_P(URLLoaderSyncOrAsyncTrustTokenOperationTest,
HandlesTrustTokenFollowedByAttribution) { … }
TEST_P(URLLoaderSyncOrAsyncTrustTokenOperationTest,
HandlesTrustTokenBeginFailure) { … }
TEST_P(URLLoaderSyncOrAsyncTrustTokenOperationTest,
HandlesTrustTokenFinalizeFailure) { … }
TEST_P(URLLoaderSyncOrAsyncTrustTokenOperationTest,
HandlesTrustTokenRequestHelperCreationFailure) { … }
TEST_P(URLLoaderSyncOrAsyncTrustTokenOperationTest,
HandlesTrustTokenRequestHelperCreationBlocked) { … }
TEST_F(URLLoaderTest, OnRawRequestClientSecurityStateFactory) { … }
TEST_F(URLLoaderTest, OnRawRequestClientSecurityStateRequest) { … }
TEST_F(URLLoaderTest, OnRawRequestClientSecurityStateNotPresent) { … }
TEST_F(URLLoaderTest, OnRawResponseIPAddressSpace) { … }
TEST_F(URLLoaderMockSocketTest, OrbDoesNotCloseSocketsWhenResourcesNotBlocked) { … }
TEST_F(URLLoaderMockSocketTest, OrbClosesSocketOnReceivingHeaders) { … }
TEST_F(URLLoaderMockSocketTest,
OrbDoesNotCloseSocketsWhenResourcesNotBlockedAfterSniffingMimeType) { … }
TEST_F(URLLoaderMockSocketTest, OrbClosesSocketOnSniffingMimeType) { … }
TEST_F(URLLoaderMockSocketTest, CorpClosesSocket) { … }
class URLLoaderMockSocketAuctionOnlyTest
: public URLLoaderMockSocketTest,
public testing::WithParamInterface<std::string> { … };
TEST_P(URLLoaderMockSocketAuctionOnlyTest,
FetchAuctionOnlySignalsFromRendererClosesSocket) { … }
TEST_P(URLLoaderMockSocketAuctionOnlyTest,
FetchAuctionOnlySignalsFromBrowserProcessSucceeds) { … }
INSTANTIATE_TEST_SUITE_P(…);
TEST_F(URLLoaderMockSocketTest, PrivateNetworkRequestPolicyDoesNotCloseSocket) { … }
TEST_F(URLLoaderTest, WithDnsAliases) { … }
TEST_F(URLLoaderTest, NoAdditionalDnsAliases) { … }
TEST_F(URLLoaderTest,
PrivateNetworkRequestPolicyReportsOnPrivateNetworkRequestWarn) { … }
TEST_F(URLLoaderTest,
PrivateNetworkRequestPolicyReportsOnPrivateNetworkRequestBlock) { … }
TEST_F(URLLoaderTest,
PrivateNetworkRequestPolicyReportsOnPrivateNetworkRequestAllow) { … }
TEST_F(URLLoaderFakeTransportInfoTest, AcceptCHFrameEmptyString) { … }
TEST_F(URLLoaderFakeTransportInfoTest, AcceptCHFrameParseString) { … }
TEST_F(URLLoaderFakeTransportInfoTest, AcceptCHFrameRemoveDuplicates) { … }
TEST_F(URLLoaderFakeTransportInfoTest, AcceptCHFrameIgnoreMalformed) { … }
TEST_F(URLLoaderTest, CookieSettingOverridesCopiedToURLRequest) { … }
TEST_F(URLLoaderTest, ReadAndDiscardBody) { … }
class SharedStorageRequestHelperURLLoaderTest : public URLLoaderTest { … };
TEST_F(SharedStorageRequestHelperURLLoaderTest, SimpleRequest) { … }
TEST_F(SharedStorageRequestHelperURLLoaderTest, SimpleRedirect) { … }
TEST_F(SharedStorageRequestHelperURLLoaderTest, MultipleRedirects) { … }
TEST_F(SharedStorageRequestHelperURLLoaderTest, CrossSiteRedirect) { … }
TEST_F(SharedStorageRequestHelperURLLoaderTest, RedirectNoLongerEligible) { … }
TEST_F(SharedStorageRequestHelperURLLoaderTest, RedirectBecomesEligible) { … }
}