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

Unified Diff: content/renderer/media_recorder/video_track_recorder_unittest.cc

Issue 2795043002: Merge 58: Reland: Copy based on coded size in VideoTrackRecorder::VEAEncoder (Closed)
Patch Set: Created 3 years, 9 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_recorder/video_track_recorder.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_recorder/video_track_recorder_unittest.cc
diff --git a/content/renderer/media_recorder/video_track_recorder_unittest.cc b/content/renderer/media_recorder/video_track_recorder_unittest.cc
index 3440bd7d2cf11ceda30b077458e2f1a7caa468cf..093d2cf0045407de5bbfe84b3f4aacc756852aa4 100644
--- a/content/renderer/media_recorder/video_track_recorder_unittest.cc
+++ b/content/renderer/media_recorder/video_track_recorder_unittest.cc
@@ -188,6 +188,29 @@ TEST_P(VideoTrackRecorderTest, VideoEncoding) {
Mock::VerifyAndClearExpectations(this);
}
+// Inserts a frame which has different coded size than the visible rect and
+// expects encode to be completed without raising any sanitizer flags.
+TEST_P(VideoTrackRecorderTest, EncodeFrameWithPaddedCodedSize) {
+ const gfx::Size& frame_size = testing::get<1>(GetParam());
+ const size_t kCodedSizePadding = 16;
+ const scoped_refptr<VideoFrame> video_frame =
+ VideoFrame::CreateZeroInitializedFrame(
+ media::PIXEL_FORMAT_I420,
+ gfx::Size(frame_size.width() + kCodedSizePadding,
+ frame_size.height()),
+ gfx::Rect(frame_size), frame_size, base::TimeDelta());
+
+ base::RunLoop run_loop;
+ base::Closure quit_closure = run_loop.QuitClosure();
+ EXPECT_CALL(*this, DoOnEncodedVideo(_, _, _, true))
+ .Times(1)
+ .WillOnce(RunClosure(quit_closure));
+ Encode(video_frame, base::TimeTicks::Now());
+ run_loop.Run();
+
+ Mock::VerifyAndClearExpectations(this);
+}
+
INSTANTIATE_TEST_CASE_P(,
VideoTrackRecorderTest,
::testing::Combine(ValuesIn(kTrackRecorderTestCodec),
« no previous file with comments | « content/renderer/media_recorder/video_track_recorder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698