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

// Copyright 2022 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/event_upload_size_controller.h"

#include <algorithm>
#include <cstdint>
#include <optional>
#include <string>

#include "base/test/protobuf_matchers.h"
#include "chrome/browser/policy/messaging_layer/upload/testing_network_condition_service.h"
#include "components/reporting/proto/synced/record.pb.h"
#include "content/public/test/browser_task_environment.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

EqualsProto;
Matches;
SizeIs;

namespace reporting {
namespace {

class EqualsProtoVector {};
}  // namespace

// Testing |EventUploadSizeController|. Since a big portion of the class is
// simply applying a formula, there is no reason to repeat the formula here.
// This test focuses on the dynamic elements (such as |AccountForRecord|).
class EventUploadSizeControllerTest : public ::testing::Test {};

// Although |EventUploadSizeController::AccountForRecord| and
// |EventUploadSizeController::IsMaximumUploadSizeReached| are private, the
// class is designed in a way that these two methods can be made public in the
// future without disruption. Hence, this test is kept here.
TEST_F(EventUploadSizeControllerTest, AccountForRecordAddUp) {}

TEST_F(EventUploadSizeControllerTest, AccountForFileUpload) {}

// Tests BuildEncryptedRecords when all input are returned.
TEST_F(EventUploadSizeControllerTest, BuildEncryptedRecordsAll) {}

// Tests BuildEncryptedRecords when only part of the input are returned.
TEST_F(EventUploadSizeControllerTest, BuildEncryptedRecordsPart) {}

// Tests BuildEncryptedRecords when only part of the input are returned and
// record_copy is present (thus upload buffer is used).
TEST_F(EventUploadSizeControllerTest, BuildEncryptedRecordsPartWithRecordCopy) {}
}  // namespace reporting