chromium/chrome/browser/policy/messaging_layer/upload/server_uploader_unittest.cc

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

#include "chrome/browser/policy/messaging_layer/upload/server_uploader.h"

#include <memory>
#include <tuple>
#include <utility>
#include <vector>

#include "base/functional/callback_helpers.h"
#include "base/strings/strcat.h"
#include "base/strings/string_number_conversions.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/task_runner.h"
#include "base/task/thread_pool.h"
#include "base/test/task_environment.h"
#include "base/types/expected.h"
#include "components/reporting/resources/resource_manager.h"
#include "components/reporting/util/status.h"
#include "components/reporting/util/test_support_callbacks.h"
#include "content/public/test/browser_task_environment.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

_;
Eq;
Invoke;
MockFunction;
Property;
Return;
StrictMock;
WithArgs;

namespace reporting {
namespace {

EncryptedRecord DummyRecord() {}

class TestRecordHandler : public ServerUploader::RecordHandler {};

class ServerUploaderTestBase {};

class ServerUploaderFailureTest : public ServerUploaderTestBase,
                                  public ::testing::TestWithParam<error::Code> {};

class ServerUploaderTest : public ServerUploaderTestBase,
                           public ::testing::TestWithParam<
                               ::testing::tuple</*need_encryption_key*/ bool,
                                                /*force_confirm*/ bool>> {};

TestSuccessfulUpload;
TestEncryptionKeyAttached;
TestConfigFileAttached;

TEST_P(ServerUploaderTest, ProcessesRecord) {}

TEST_P(ServerUploaderTest, ProcessesRecords) {}

TEST_P(ServerUploaderTest, ReportsFailureToProcess) {}

TEST_P(ServerUploaderTest, ReportWithZeroRecords) {}

TEST_P(ServerUploaderFailureTest, ReportsFailureToUpload) {}

INSTANTIATE_TEST_SUITE_P();

INSTANTIATE_TEST_SUITE_P();
}  // namespace
}  // namespace reporting