Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(464)

Unified Diff: content/renderer/media/rtc_video_decoder_unittest.cc

Issue 1850063003: Dynamic error tracking in RTCVideoDecoder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/media/rtc_video_decoder.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/rtc_video_decoder_unittest.cc
diff --git a/content/renderer/media/rtc_video_decoder_unittest.cc b/content/renderer/media/rtc_video_decoder_unittest.cc
index 5c5d80ee5d783b9002196f1d241bc8d577943e7d..0c2523747cc4090db62f16d9fb709174f47fde40 100644
--- a/content/renderer/media/rtc_video_decoder_unittest.cc
+++ b/content/renderer/media/rtc_video_decoder_unittest.cc
@@ -272,7 +272,7 @@ TEST_F(RTCVideoDecoderTest, IsFirstBufferAfterReset) {
}
-TEST_P(RTCVideoDecoderTest, DecodeResetsAfterError) {
+TEST_P(RTCVideoDecoderTest, GetVDAErrorCounterForTesting) {
const webrtc::VideoCodecType codec_type = GetParam();
CreateDecoder(codec_type);
Initialize();
@@ -289,11 +289,24 @@ TEST_P(RTCVideoDecoderTest, DecodeResetsAfterError) {
// Notify the decoder about a platform error.
NotifyError(media::VideoDecodeAccelerator::PLATFORM_FAILURE);
RunUntilIdle();
+ EXPECT_EQ(1, rtc_decoder_->GetVDAErrorCounterForTesting());
// Expect decode call to reset decoder, and set up a new VDA to track it.
SetUpResetVDA();
EXPECT_EQ(WEBRTC_VIDEO_CODEC_ERROR,
rtc_decoder_->Decode(input_image, false, nullptr, nullptr, 0));
+ EXPECT_EQ(1, rtc_decoder_->GetVDAErrorCounterForTesting());
+
+ // Decoder expects a keyframe after reset, so drops any other frames.
+ EXPECT_EQ(WEBRTC_VIDEO_CODEC_ERROR,
+ rtc_decoder_->Decode(input_image, false, nullptr, nullptr, 0));
+ EXPECT_EQ(1, rtc_decoder_->GetVDAErrorCounterForTesting());
+
+ // Decoder resets error counter after a successfull decode.
+ input_image._frameType = webrtc::kVideoFrameKey;
+ EXPECT_EQ(WEBRTC_VIDEO_CODEC_OK,
+ rtc_decoder_->Decode(input_image, false, nullptr, nullptr, 10));
+ EXPECT_EQ(0, rtc_decoder_->GetVDAErrorCounterForTesting());
}
INSTANTIATE_TEST_CASE_P(CodecProfiles,
« no previous file with comments | « content/renderer/media/rtc_video_decoder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698