chromium/third_party/blink/renderer/platform/testing/url_loader_mock.cc

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

#include "third_party/blink/renderer/platform/testing/url_loader_mock.h"

#include <utility>

#include "base/task/single_thread_task_runner.h"
#include "net/cookies/site_for_cookies.h"
#include "services/network/public/cpp/resource_request.h"
#include "third_party/blink/public/platform/resource_load_info_notifier_wrapper.h"
#include "third_party/blink/public/platform/url_conversion.h"
#include "third_party/blink/public/platform/web_security_origin.h"
#include "third_party/blink/public/platform/web_url_error.h"
#include "third_party/blink/public/platform/web_url_request_extra_data.h"
#include "third_party/blink/renderer/platform/loader/fetch/url_loader/url_loader_client.h"
#include "third_party/blink/renderer/platform/network/http_names.h"
#include "third_party/blink/renderer/platform/scheduler/test/fake_task_runner.h"
#include "third_party/blink/renderer/platform/testing/url_loader_mock_factory_impl.h"
#include "third_party/blink/renderer/platform/weborigin/security_origin.h"
#include "third_party/blink/renderer/platform/wtf/shared_buffer.h"

namespace blink {

URLLoaderMock::URLLoaderMock(URLLoaderMockFactoryImpl* factory)
    :{}

URLLoaderMock::~URLLoaderMock() {}

void URLLoaderMock::ServeAsynchronousRequest(
    URLLoaderTestDelegate* delegate,
    const WebURLResponse& response,
    const scoped_refptr<SharedBuffer>& data,
    const std::optional<WebURLError>& error) {}

WebURL URLLoaderMock::ServeRedirect(const WebString& method,
                                    const WebURLResponse& redirect_response) {}

void URLLoaderMock::LoadSynchronously(
    std::unique_ptr<network::ResourceRequest> request,
    scoped_refptr<const SecurityOrigin> top_frame_origin,
    bool download_to_blob,
    bool no_mime_sniffing,
    base::TimeDelta timeout_interval,
    URLLoaderClient* client,
    WebURLResponse& response,
    std::optional<WebURLError>& error,
    scoped_refptr<SharedBuffer>& data,
    int64_t& encoded_data_length,
    uint64_t& encoded_body_length,
    scoped_refptr<BlobDataHandle>& downloaded_blob,
    std::unique_ptr<blink::ResourceLoadInfoNotifierWrapper>
        resource_load_info_notifier_wrapper) {}

void URLLoaderMock::LoadAsynchronously(
    std::unique_ptr<network::ResourceRequest> request,
    scoped_refptr<const SecurityOrigin> top_frame_origin,
    bool no_mime_sniffing,
    std::unique_ptr<blink::ResourceLoadInfoNotifierWrapper>
        resource_load_info_notifier_wrapper,
    CodeCacheHost* code_cache_host,
    URLLoaderClient* client) {}

void URLLoaderMock::Cancel() {}

void URLLoaderMock::Freeze(LoaderFreezeMode mode) {}

void URLLoaderMock::DidChangePriority(WebURLRequest::Priority new_priority,
                                      int intra_priority_value) {}

scoped_refptr<base::SingleThreadTaskRunner>
URLLoaderMock::GetTaskRunnerForBodyLoader() {}

base::WeakPtr<URLLoaderMock> URLLoaderMock::GetWeakPtr() {}

}  // namespace blink