chromium/third_party/blink/renderer/platform/loader/fetch/url_loader/navigation_body_loader_unittest.cc

// Copyright 2019 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/loader/fetch/url_loader/navigation_body_loader.h"

#include <string_view>

#include "base/containers/span.h"
#include "base/functional/bind.h"
#include "base/run_loop.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/task_environment.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "net/cert/x509_util.h"
#include "net/ssl/ssl_connection_status_flags.h"
#include "net/test/cert_test_util.h"
#include "services/network/public/cpp/url_loader_completion_status.h"
#include "services/network/public/mojom/fetch_api.mojom.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/common/navigation/navigation_params.h"
#include "third_party/blink/public/mojom/navigation/navigation_params.mojom.h"
#include "third_party/blink/public/platform/resource_load_info_notifier_wrapper.h"
#include "third_party/blink/public/platform/scheduler/test/renderer_scheduler_test_support.h"
#include "third_party/blink/public/platform/web_navigation_body_loader.h"
#include "third_party/blink/public/web/web_navigation_params.h"
#include "third_party/blink/renderer/platform/loader/fetch/body_text_decoder.h"
#include "third_party/blink/renderer/platform/loader/fetch/code_cache_host.h"
#include "third_party/blink/renderer/platform/loader/fetch/resource_response.h"
#include "third_party/blink/renderer/platform/weborigin/referrer.h"
#include "third_party/blink/renderer/platform/wtf/cross_thread_functional.h"

namespace blink {

namespace {

ElementsAre;

class UppercaseDecoder : public BodyTextDecoder {};

class NavigationBodyLoaderTest : public ::testing::Test,
                                 public WebNavigationBodyLoader::Client {};

TEST_F(NavigationBodyLoaderTest, SetDefersBeforeStart) {}

TEST_F(NavigationBodyLoaderTest, DecodedDataReceived) {}

TEST_F(NavigationBodyLoaderTest, ProcessBackgroundData) {}

TEST_F(NavigationBodyLoaderTest, DataReceived) {}

TEST_F(NavigationBodyLoaderTest, DataReceivedFromDataReceived) {}

TEST_F(NavigationBodyLoaderTest, DestroyFromDataReceived) {}

TEST_F(NavigationBodyLoaderTest, SetDefersLoadingFromDataReceived) {}

TEST_F(NavigationBodyLoaderTest, StartDeferred) {}

TEST_F(NavigationBodyLoaderTest, StartDeferredWithBackForwardCache) {}

TEST_F(NavigationBodyLoaderTest, OnCompleteThenClose) {}

TEST_F(NavigationBodyLoaderTest, DestroyFromOnCompleteThenClose) {}

TEST_F(NavigationBodyLoaderTest, SetDefersLoadingFromOnCompleteThenClose) {}

TEST_F(NavigationBodyLoaderTest, CloseThenOnComplete) {}

TEST_F(NavigationBodyLoaderTest, DestroyFromCloseThenOnComplete) {}

TEST_F(NavigationBodyLoaderTest, SetDefersLoadingFromCloseThenOnComplete) {}

// Tests that FillNavigationParamsResponseAndBodyLoader populates security
// details on the response when they are present.
TEST_F(NavigationBodyLoaderTest, FillResponseWithSecurityDetails) {}

// Tests that FillNavigationParamsResponseAndBodyLoader populates referrer
// on redirects correctly.
TEST_F(NavigationBodyLoaderTest, FillResponseReferrerRedirects) {}

// A loader client which keeps track of chunks of data that are received in a
// single PostTask.
class ChunkingLoaderClient : public WebNavigationBodyLoader::Client {};

TEST_F(NavigationBodyLoaderTest, MaxDataSize1) {}

TEST_F(NavigationBodyLoaderTest, MaxDataSize2) {}

TEST_F(NavigationBodyLoaderTest, MaxDataSizeAll) {}

}  // namespace

}  // namespace blink