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

Unified Diff: media/cast/receiver/video_decoder_unittest.cc

Issue 581903002: [Cast] Fix referenced_frame_ids emitted by Vp8Encoder, with massive test clean-up. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | « no previous file | media/cast/sender/video_encoder_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cast/receiver/video_decoder_unittest.cc
diff --git a/media/cast/receiver/video_decoder_unittest.cc b/media/cast/receiver/video_decoder_unittest.cc
index c8428353382079bd3e78ae5e035c99282b70b833..95d92b8064fd5b63a04a9a520b23d69ad554bc1f 100644
--- a/media/cast/receiver/video_decoder_unittest.cc
+++ b/media/cast/receiver/video_decoder_unittest.cc
@@ -12,6 +12,7 @@
#include "media/cast/cast_config.h"
#include "media/cast/receiver/video_decoder.h"
#include "media/cast/sender/vp8_encoder.h"
+#include "media/cast/test/utility/default_config.h"
#include "media/cast/test/utility/standalone_cast_environment.h"
#include "media/cast/test/utility/video_utility.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -26,7 +27,7 @@ const int kHeight = 240;
const int kFrameRate = 10;
VideoSenderConfig GetVideoSenderConfigForTest() {
- VideoSenderConfig config;
+ VideoSenderConfig config = GetDefaultVideoSenderConfig();
config.width = kWidth;
config.height = kHeight;
config.max_frame_rate = kFrameRate;
@@ -83,7 +84,12 @@ class VideoDecoderTest : public ::testing::TestWithParam<Codec> {
// Test only supports VP8, currently.
CHECK_EQ(CODEC_VIDEO_VP8, GetParam());
vp8_encoder_.Encode(video_frame, encoded_frame.get());
+ // Rewrite frame IDs for testing purposes.
encoded_frame->frame_id = last_frame_id_ + 1 + num_dropped_frames;
+ if (last_frame_id_ == 0)
+ encoded_frame->referenced_frame_id = encoded_frame->frame_id;
+ else
+ encoded_frame->referenced_frame_id = encoded_frame->frame_id - 1;
last_frame_id_ = encoded_frame->frame_id;
{
« no previous file with comments | « no previous file | media/cast/sender/video_encoder_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698