#include "third_party/blink/public/common/loader/throttling_url_loader.h"
#include "base/functional/bind.h"
#include "base/memory/ptr_util.h"
#include "base/memory/raw_ptr.h"
#include "base/notreached.h"
#include "base/run_loop.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/bind.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/task_environment.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "net/traffic_annotation/network_traffic_annotation_test_helper.h"
#include "services/network/public/cpp/features.h"
#include "services/network/public/cpp/weak_wrapper_shared_url_loader_factory.h"
#include "services/network/public/mojom/early_hints.mojom.h"
#include "services/network/public/mojom/url_loader.mojom.h"
#include "services/network/public/mojom/url_loader_factory.mojom.h"
#include "services/network/public/mojom/url_response_head.mojom.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/loader/url_loader_throttle.h"
namespace blink {
namespace {
GURL request_url = …;
GURL redirect_url = …;
RestartWithURLReset;
class TestURLLoaderFactory : public network::mojom::URLLoaderFactory,
public network::mojom::URLLoader { … };
class TestURLLoaderClient : public network::mojom::URLLoaderClient { … };
class TestURLLoaderThrottle : public blink::URLLoaderThrottle { … };
class ThrottlingURLLoaderTest : public testing::Test { … };
TEST_F(ThrottlingURLLoaderTest, CancelBeforeStart) { … }
TEST_F(ThrottlingURLLoaderTest, DeleteBeforeStart) { … }
TEST_F(ThrottlingURLLoaderTest, DeferBeforeStart) { … }
TEST_F(ThrottlingURLLoaderTest, ModifyURLBeforeStart) { … }
TEST_F(ThrottlingURLLoaderTest,
CrossOriginRedirectBeforeStartWithIsolationInfo) { … }
TEST_F(ThrottlingURLLoaderTest, ModifyURLAndDeferRedirect) { … }
TEST_F(ThrottlingURLLoaderTest,
RedirectCallbackShouldNotBeCalledAfterDestruction) { … }
TEST_F(ThrottlingURLLoaderTest, CancelBeforeRedirect) { … }
TEST_F(ThrottlingURLLoaderTest, DeleteBeforeRedirect) { … }
TEST_F(ThrottlingURLLoaderTest, CancelBeforeWillRedirect) { … }
TEST_F(ThrottlingURLLoaderTest, DeleteBeforeWillRedirect) { … }
TEST_F(ThrottlingURLLoaderTest, DeferBeforeRedirect) { … }
TEST_F(ThrottlingURLLoaderTest, ModifyHeadersBeforeRedirect) { … }
TEST_F(ThrottlingURLLoaderTest, MultipleThrottlesModifyHeadersBeforeRedirect) { … }
TEST_F(ThrottlingURLLoaderTest, CancelBeforeResponse) { … }
TEST_F(ThrottlingURLLoaderTest, DeleteBeforeResponse) { … }
TEST_F(ThrottlingURLLoaderTest, CancelBeforeWillProcessResponse) { … }
TEST_F(ThrottlingURLLoaderTest, DeleteBeforeWillProcessResponse) { … }
TEST_F(ThrottlingURLLoaderTest, DeferBeforeResponse) { … }
TEST_F(ThrottlingURLLoaderTest, PipeClosure) { … }
TEST_F(ThrottlingURLLoaderTest, ResumeNoOpIfNotDeferred) { … }
TEST_F(ThrottlingURLLoaderTest, CancelNoOpIfAlreadyCanceled) { … }
TEST_F(ThrottlingURLLoaderTest, ResumeNoOpIfAlreadyCanceled) { … }
TEST_F(ThrottlingURLLoaderTest, MultipleThrottlesBasicSupport) { … }
TEST_F(ThrottlingURLLoaderTest, BlockWithOneOfMultipleThrottles) { … }
TEST_F(ThrottlingURLLoaderTest, BlockWithMultipleThrottles) { … }
TEST_F(ThrottlingURLLoaderTest,
DestroyingThrottlingURLLoaderInDelegateCall_Response) { … }
TEST_F(ThrottlingURLLoaderTest,
DestroyingThrottlingURLLoaderInDelegateCall_Redirect) { … }
TEST_F(ThrottlingURLLoaderTest, RestartWithURLReset) { … }
TEST_F(ThrottlingURLLoaderTest, MultipleRestartWithURLReset) { … }
TEST_F(ThrottlingURLLoaderTest, RestartWithURLResetBeforeWillRedirectRequest) { … }
}
}