chromium/components/policy/core/common/cloud/external_policy_data_updater_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_updater.h"

#include <stddef.h>
#include <stdint.h>

#include <memory>

#include "base/compiler_specific.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/functional/callback_helpers.h"
#include "base/run_loop.h"
#include "base/test/task_environment.h"
#include "base/test/test_pending_task.h"
#include "base/test/test_simple_task_runner.h"
#include "base/time/time.h"
#include "components/policy/core/common/cloud/external_policy_data_fetcher.h"
#include "crypto/sha2.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/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"

Mock;
Return;

namespace policy {

namespace {

const char* kExternalPolicyDataKeys[] =;
const char* kExternalPolicyDataURLs[] =;

const int64_t kExternalPolicyDataMaxSize =;

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

class MockFetchSuccessCallbackListener {};

ExternalPolicyDataUpdater::FetchSuccessCallback
    MockFetchSuccessCallbackListener::CreateCallback(const std::string& key) {}

}  // namespace

class ExternalPolicyDataUpdaterTest : public testing::Test {};

void ExternalPolicyDataUpdaterTest::SetUp() {}

void ExternalPolicyDataUpdaterTest::CreateUpdater(size_t max_parallel_fetches) {}

void ExternalPolicyDataUpdaterTest::RequestExternalDataFetchAndWait(int index) {}

void ExternalPolicyDataUpdaterTest::RequestExternalDataFetchAndWait(
    int key_index,
    int url_index) {}

void ExternalPolicyDataUpdaterTest::RequestExternalDataFetch(int index) {}

void ExternalPolicyDataUpdaterTest::RequestExternalDataFetch(int key_index,
                                                             int url_index) {}

ExternalPolicyDataUpdater::Request
    ExternalPolicyDataUpdaterTest::CreateRequest(const std::string& url) const {}

TEST_F(ExternalPolicyDataUpdaterTest, FetchSuccess) {}

TEST_F(ExternalPolicyDataUpdaterTest, PayloadSizeExceedsLimit) {}

TEST_F(ExternalPolicyDataUpdaterTest, FetchFailure) {}

TEST_F(ExternalPolicyDataUpdaterTest, ServerFailure) {}

TEST_F(ExternalPolicyDataUpdaterTest, RetryLimit) {}

TEST_F(ExternalPolicyDataUpdaterTest, RetryWithBackoff) {}

TEST_F(ExternalPolicyDataUpdaterTest, CancelDelayedTsaks) {}

TEST_F(ExternalPolicyDataUpdaterTest, HashInvalid) {}

TEST_F(ExternalPolicyDataUpdaterTest, DataRejectedByCallback) {}

TEST_F(ExternalPolicyDataUpdaterTest, URLChanged) {}

TEST_F(ExternalPolicyDataUpdaterTest, JobInvalidated) {}

TEST_F(ExternalPolicyDataUpdaterTest, FetchCanceled) {}

TEST_F(ExternalPolicyDataUpdaterTest, ParallelJobs) {}

TEST_F(ExternalPolicyDataUpdaterTest, ParallelJobsFinishingOutOfOrder) {}

TEST_F(ExternalPolicyDataUpdaterTest, ParallelJobsWithRetry) {}

TEST_F(ExternalPolicyDataUpdaterTest, ParallelJobsWithCancel) {}

TEST_F(ExternalPolicyDataUpdaterTest, ParallelJobsWithInvalidatedJob) {}

}  // namespace policy