#include "third_party/blink/renderer/modules/webcodecs/reclaimable_codec.h"
#include "base/test/scoped_feature_list.h"
#include "base/test/simple_test_tick_clock.h"
#include "base/time/default_tick_clock.h"
#include "base/time/time.h"
#include "media/base/test_helpers.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/bindings/core/v8/v8_binding_for_testing.h"
#include "third_party/blink/renderer/modules/webcodecs/codec_pressure_gauge.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/testing/task_environment.h"
namespace blink {
static constexpr size_t kTestPressureThreshold = …;
namespace {
constexpr base::TimeDelta kTimerPeriod = …;
class FakeReclaimableCodec final
: public GarbageCollected<FakeReclaimableCodec>,
public ReclaimableCodec { … };
}
class ReclaimableCodecTest
: public testing::TestWithParam<ReclaimableCodec::CodecType> { … };
void TestBackgroundInactivityTimerStartStops(FakeReclaimableCodec* codec) { … }
void TestBackgroundInactivityTimerWorks(FakeReclaimableCodec* codec) { … }
TEST_P(ReclaimableCodecTest, BackgroundInactivityTimerStartStops) { … }
TEST_P(ReclaimableCodecTest, BackgroundInactivityTimerWorks) { … }
TEST_P(ReclaimableCodecTest, ForegroundInactivityTimerNeverStarts) { … }
TEST_P(ReclaimableCodecTest, ForegroundCodecReclaimedOnceBackgrounded) { … }
TEST_P(ReclaimableCodecTest, RepeatLifecycleEventsDontBreakState) { … }
TEST_P(ReclaimableCodecTest, PressureChangesUpdateTimer) { … }
INSTANTIATE_TEST_SUITE_P(…);
}