chromium/third_party/blink/renderer/platform/loader/testing/fake_url_loader_factory_for_background_thread.h

// Copyright 2024 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_PLATFORM_LOADER_TESTING_FAKE_URL_LOADER_FACTORY_FOR_BACKGROUND_THREAD_H_
#define THIRD_PARTY_BLINK_RENDERER_PLATFORM_LOADER_TESTING_FAKE_URL_LOADER_FACTORY_FOR_BACKGROUND_THREAD_H_

#include "base/functional/callback.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "mojo/public/cpp/bindings/receiver_set.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
#include "services/network/public/mojom/url_loader.mojom-forward.h"

namespace blink {

// A fake SharedURLLoaderFactory that can handle a fetch request on the
// background thread. This SharedURLLoaderFactory is cloned and passed to a
// background thread via PendingFactory.
// This class can be used for testing the behaviour of a fetch request with a
// BackgroundURLLoader, or a synchronous fetch request.
class FakeURLLoaderFactoryForBackgroundThread
    : public network::SharedURLLoaderFactory {};

}  // namespace blink

#endif  // THIRD_PARTY_BLINK_RENDERER_PLATFORM_LOADER_TESTING_FAKE_URL_LOADER_FACTORY_FOR_BACKGROUND_THREAD_H_