chromium/components/reporting/resources/resource_manager_unittest.cc

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

#include "components/reporting/resources/resource_manager.h"

#include <cstdint>
#include <utility>

#include "base/functional/bind.h"
#include "base/memory/scoped_refptr.h"
#include "base/sequence_checker.h"
#include "base/task/sequenced_task_runner.h"
#include "base/task/thread_pool.h"
#include "base/test/task_environment.h"
#include "base/time/time.h"
#include "components/reporting/util/test_support_callbacks.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"

Eq;

namespace reporting {
namespace {

class ResourceInterfaceTest : public ::testing::TestWithParam<uint64_t> {};

TEST_P(ResourceInterfaceTest, NestedReservationTest) {}

TEST_P(ResourceInterfaceTest, SimultaneousReservationTest) {}

TEST_P(ResourceInterfaceTest, SimultaneousScopedReservationTest) {}

TEST_P(ResourceInterfaceTest, MoveScopedReservationTest) {}

TEST_P(ResourceInterfaceTest, ScopedReservationBasicReduction) {}

TEST_P(ResourceInterfaceTest, ScopedReservationReductionWithLargerNewSize) {}

TEST_P(ResourceInterfaceTest, ScopedReservationReductionWithNegativeNewSize) {}

TEST_P(ResourceInterfaceTest, ScopedReservationRepeatingReductions) {}

TEST_P(ResourceInterfaceTest, ScopedReservationBasicHandOver) {}

TEST_P(ResourceInterfaceTest, ScopedReservationRepeatingHandOvers) {}

TEST_P(ResourceInterfaceTest, ScopedReservationRepeatingCopyHandOvers) {}

TEST_P(ResourceInterfaceTest, ScopedReservationFailureToCopyFromEmpty) {}

TEST_P(ResourceInterfaceTest, ScopedReservationRepeatingHandOversToEmpty) {}

TEST_P(ResourceInterfaceTest, ScopedReservationEmptyHandOver) {}

TEST_P(ResourceInterfaceTest, ReservationOverMaxTest) {}

// Helper class with the following behavior:
// - Once created, immediately posts `Start` action on a dedicated task runner
// - `Start` registers a callback for `size` resource
// - When Callback happens (on the same task runner), the work is done;
//   `done` is called and then teh `Actor` commits suiside.
class Actor {};

TEST_P(ResourceInterfaceTest, ReservationWithWaits) {}

TEST_P(ResourceInterfaceTest, ReservationWithWaitsOnEmptyReservation) {}

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