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

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

Issue 2093823002: Consider non-keyframes for RTCVideoEncoder error counter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
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 de9717ad59631a72dc7835bd4be57fc7e41ae678..acf8f1afaf5c04bbf55a9ca210ff0fc2e888e66f 100644
--- a/content/renderer/media/rtc_video_decoder_unittest.cc
+++ b/content/renderer/media/rtc_video_decoder_unittest.cc
@@ -293,6 +293,7 @@ TEST_P(RTCVideoDecoderTest, GetVDAErrorCounterForTesting) {
input_image._encodedWidth = kMinResolutionWidth;
input_image._encodedHeight = kMaxResolutionHeight;
input_image._frameType = webrtc::kVideoFrameDelta;
+ input_image._length = kMinResolutionWidth * kMaxResolutionHeight;
EXPECT_EQ(WEBRTC_VIDEO_CODEC_ERROR,
rtc_decoder_->Decode(input_image, false, nullptr, nullptr, 0));
RunUntilIdle();
@@ -308,16 +309,11 @@ TEST_P(RTCVideoDecoderTest, GetVDAErrorCounterForTesting) {
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.
+ // Decoder expects a keyframe after reset, so drops any other frames. However,
+ // we should still increment the error counter.
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());
+ EXPECT_EQ(2, rtc_decoder_->GetVDAErrorCounterForTesting());
}
INSTANTIATE_TEST_CASE_P(CodecProfiles,
« content/renderer/media/rtc_video_decoder.cc ('K') | « 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