chromium/components/policy/core/common/cloud/external_policy_data_fetcher_unittest.cc

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

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/40285824): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include "components/policy/core/common/cloud/external_policy_data_fetcher.h"

#include <stdint.h>
#include <utility>

#include "base/compiler_specific.h"
#include "base/functional/bind.h"
#include "base/functional/callback_helpers.h"
#include "base/run_loop.h"
#include "base/task/sequenced_task_runner.h"
#include "base/test/task_environment.h"
#include "base/test/test_simple_task_runner.h"
#include "net/base/net_errors.h"
#include "services/network/public/cpp/weak_wrapper_shared_url_loader_factory.h"
#include "services/network/public/mojom/url_response_head.mojom.h"
#include "services/network/test/test_url_loader_factory.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace policy {

namespace {

const char* kExternalPolicyDataURLs[] =;

const int64_t kExternalPolicyDataMaxSize =;

const char* kExternalPolicyDataPayload =;
const char* kExternalPolicyDataOverflowPayload =;

}  // namespace

class ExternalPolicyDataFetcherTest : public testing::Test {};

ExternalPolicyDataFetcherTest::ExternalPolicyDataFetcherTest()
    :{}

ExternalPolicyDataFetcherTest::~ExternalPolicyDataFetcherTest() {}

void ExternalPolicyDataFetcherTest::SetUp() {}

void ExternalPolicyDataFetcherTest::StartJob(int index) {}

void ExternalPolicyDataFetcherTest::CancelJob(int index) {}

void ExternalPolicyDataFetcherTest::OnJobFinished(
    int job_index,
    ExternalPolicyDataFetcher::Result result,
    std::unique_ptr<std::string> data) {}

int ExternalPolicyDataFetcherTest::GetAndResetCallbackCount() {}

TEST_F(ExternalPolicyDataFetcherTest, Success) {}

TEST_F(ExternalPolicyDataFetcherTest, MaxSizeExceeded) {}

TEST_F(ExternalPolicyDataFetcherTest, ConnectionInterrupted) {}

TEST_F(ExternalPolicyDataFetcherTest, NetworkError) {}

TEST_F(ExternalPolicyDataFetcherTest, ServerError) {}

TEST_F(ExternalPolicyDataFetcherTest, ClientError) {}

TEST_F(ExternalPolicyDataFetcherTest, HTTPError) {}

TEST_F(ExternalPolicyDataFetcherTest, Canceled) {}

TEST_F(ExternalPolicyDataFetcherTest, SuccessfulCanceled) {}

TEST_F(ExternalPolicyDataFetcherTest, ParallelJobs) {}

TEST_F(ExternalPolicyDataFetcherTest, ParallelJobsFinishingOutOfOrder) {}

TEST_F(ExternalPolicyDataFetcherTest, ParallelJobsWithCancel) {}

}  // namespace policy