#include "src/heap/cppgc/stats-collector.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace cppgc {
namespace internal {
namespace {
constexpr size_t kNoMarkedBytes = …;
constexpr size_t kMinReportedSize = …;
class StatsCollectorTest : public ::testing::Test { … };
}
TEST_F(StatsCollectorTest, NoMarkedBytes) { … }
TEST_F(StatsCollectorTest, EventPrevGCMarkedObjectSize) { … }
TEST_F(StatsCollectorTest, AllocationNoReportBelowAllocationThresholdBytes) { … }
TEST_F(StatsCollectorTest, AlllocationReportAboveAllocationThresholdBytes) { … }
TEST_F(StatsCollectorTest, InitialAllocatedObjectSize) { … }
TEST_F(StatsCollectorTest, AllocatedObjectSize) { … }
TEST_F(StatsCollectorTest, AllocatedObjectSizeNoMarkedBytes) { … }
TEST_F(StatsCollectorTest, AllocatedObjectSizeAllocateAfterMarking) { … }
class MockAllocationObserver : public StatsCollector::AllocationObserver { … };
TEST_F(StatsCollectorTest, RegisterUnregisterObserver) { … }
TEST_F(StatsCollectorTest, ObserveAllocatedObjectSizeIncreaseAndDecrease) { … }
namespace {
void FakeGC(StatsCollector* stats, size_t marked_bytes) { … }
}
TEST_F(StatsCollectorTest, ObserveResetAllocatedObjectSize) { … }
TEST_F(StatsCollectorTest, ObserveAllocatedMemoryIncreaseAndDecrease) { … }
namespace {
class AllocationObserverTriggeringGC final
: public StatsCollector::AllocationObserver { … };
}
TEST_F(StatsCollectorTest, ObserverTriggersGC) { … }
TEST_F(StatsCollectorTest, AllocatedMemorySize) { … }
TEST_F(StatsCollectorTest, DiscardedMemorySize) { … }
TEST_F(StatsCollectorTest, ResidentMemorySizeWithoutDiscarded) { … }
TEST_F(StatsCollectorTest, ResidentMemorySizeWithDiscarded) { … }
}
}