#include "third_party/blink/renderer/modules/webcodecs/codec_pressure_gauge.h"
#include "base/test/bind.h"
#include "base/test/mock_callback.h"
#include "build/build_config.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/reclaimable_codec.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/heap/thread_state.h"
_;
namespace blink {
namespace {
constexpr size_t kTestPressureThreshold = …;
MockPressureChangeCallback;
}
class CodecPressureGaugeTest
: public testing::TestWithParam<ReclaimableCodec::CodecType> { … };
TEST_P(CodecPressureGaugeTest, DefaultState) { … }
TEST_P(CodecPressureGaugeTest, GaugeIsSharedForDecodersEncoders) { … }
TEST_P(CodecPressureGaugeTest, RegisterUnregisterCallbacks) { … }
TEST_P(CodecPressureGaugeTest, IncrementDecrement) { … }
TEST_P(CodecPressureGaugeTest, UnregisterAllLeftoverPressure) { … }
TEST_P(CodecPressureGaugeTest, UnregisterPartialLeftoverPressure) { … }
TEST_P(CodecPressureGaugeTest, ExceedingThresholdRunsCallbacks) { … }
TEST_P(CodecPressureGaugeTest, PassingUnderThresholdRunsCallbacks_Decrement) { … }
TEST_P(CodecPressureGaugeTest, PassingUnderThresholdRunsCallbacks_Unregister) { … }
TEST_P(CodecPressureGaugeTest, RepeatedlyCrossingThresholds) { … }
TEST_P(CodecPressureGaugeTest, ZeroThreshold) { … }
INSTANTIATE_TEST_SUITE_P(…);
}