chromium/third_party/blink/renderer/core/testing/no_network_url_loader.h

// Copyright 2022 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef THIRD_PARTY_BLINK_RENDERER_CORE_TESTING_NO_NETWORK_URL_LOADER_H_
#define THIRD_PARTY_BLINK_RENDERER_CORE_TESTING_NO_NETWORK_URL_LOADER_H_

#include "base/task/single_thread_task_runner.h"
#include "services/network/public/cpp/resource_request.h"
#include "third_party/blink/renderer/core/loader/empty_clients.h"
#include "third_party/blink/renderer/platform/loader/fetch/url_loader/url_loader.h"
#include "third_party/blink/renderer/platform/scheduler/test/fake_task_runner.h"

namespace blink {

// A URLLoader simulating that requests time out forever due to no network.
// Useful for perftests that don't really want to benchmark URL loading.
class NoNetworkURLLoader : public URLLoader {};

// A LocalFrameClient that uses NoNetworkURLLoader, so that nothing external
// is ever loaded.
class NoNetworkLocalFrameClient : public EmptyLocalFrameClient {};

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_RENDERER_CORE_TESTING_NO_NETWORK_URL_LOADER_H_