#include "third_party/blink/renderer/platform/media/video_decode_stats_reporter.h"
#include <memory>
#include <optional>
#include "base/functional/bind.h"
#include "base/memory/raw_ptr.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_refptr.h"
#include "base/task/single_thread_task_runner.h"
#include "base/test/task_environment.h"
#include "base/time/time.h"
#include "media/base/cdm_config.h"
#include "media/base/media_util.h"
#include "media/base/video_codecs.h"
#include "media/base/video_types.h"
#include "media/capabilities/bucket_utility.h"
#include "media/mojo/mojom/media_types.mojom.h"
#include "media/mojo/mojom/video_decode_stats_recorder.mojom.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "mojo/public/cpp/bindings/self_owned_receiver.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/gfx/geometry/rect.h"
namespace blink {
Invoke;
Return;
_;
const media::VideoCodecProfile kDefaultProfile = …;
const int kDefaultHeight = …;
const int kDefaultWidth = …;
const char kDefaultKeySystem[] = …;
const bool kDefaultUseHwSecureCodecs = …;
const media::CdmConfig kDefaultCdmConfig = …;
const double kDefaultFps = …;
const int kDecodeCountIncrement = …;
const int kDroppedCountIncrement = …;
const int kDecodePowerEfficientCountIncrement = …;
media::VideoDecoderConfig MakeVideoConfig(media::VideoCodec codec,
media::VideoCodecProfile profile,
gfx::Size natural_size) { … }
media::PipelineStatistics MakeStats(int frames_decoded,
int frames_dropped,
int power_efficient_decoded_frames,
double fps) { … }
class RecordInterceptor : public media::mojom::VideoDecodeStatsRecorder { … };
class VideoDecodeStatsReporterTest : public ::testing::Test { … };
const base::TimeDelta VideoDecodeStatsReporterTest::kRecordingInterval = …;
const base::TimeDelta VideoDecodeStatsReporterTest::kTinyFpsWindowDuration = …;
TEST_F(VideoDecodeStatsReporterTest, RecordWhilePlaying) { … }
TEST_F(VideoDecodeStatsReporterTest, RecordingStopsWhenPaused) { … }
TEST_F(VideoDecodeStatsReporterTest, RecordingStopsWhenHidden) { … }
TEST_F(VideoDecodeStatsReporterTest, RecordingStopsWhenNoDecodeProgress) { … }
TEST_F(VideoDecodeStatsReporterTest, NewRecordStartsForFpsChange) { … }
TEST_F(VideoDecodeStatsReporterTest, FpsStabilizationFailed) { … }
TEST_F(VideoDecodeStatsReporterTest, FpsStabilizationFailed_TinyWindows) { … }
TEST_F(VideoDecodeStatsReporterTest, ThrottleFpsTimerIfNoDecodeProgress) { … }
TEST_F(VideoDecodeStatsReporterTest, FpsBucketing) { … }
TEST_F(VideoDecodeStatsReporterTest, ResolutionBucketing) { … }
TEST_F(VideoDecodeStatsReporterTest, ResolutionTooSmall) { … }
TEST_F(VideoDecodeStatsReporterTest, VaryEmeProperties) { … }
TEST_F(VideoDecodeStatsReporterTest, SanitizeFrameCounts) { … }
}