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

Unified Diff: webrtc/common_video/i420_video_frame_unittest.cc

Issue 2443123002: Delete ShallowCopy, in favor of copy construction and assignment. (Closed)
Patch Set: Renamed method argument. Created 4 years, 2 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: webrtc/common_video/i420_video_frame_unittest.cc
diff --git a/webrtc/common_video/i420_video_frame_unittest.cc b/webrtc/common_video/i420_video_frame_unittest.cc
index 5f8d9596f44065b3fea3b404575e9d6a01717e43..095d5fe1fb5bce8b0d4768fa638780baa46090bd 100644
--- a/webrtc/common_video/i420_video_frame_unittest.cc
+++ b/webrtc/common_video/i420_video_frame_unittest.cc
@@ -157,19 +157,14 @@ TEST(TestVideoFrame, ShallowCopy) {
frame1.set_timestamp(timestamp);
frame1.set_ntp_time_ms(ntp_time_ms);
frame1.set_render_time_ms(render_time_ms);
- VideoFrame frame2;
- frame2.ShallowCopy(frame1);
-
- // To be able to access the buffers, we need const pointers to the frames.
- const VideoFrame* const_frame1_ptr = &frame1;
- const VideoFrame* const_frame2_ptr = &frame2;
-
- EXPECT_TRUE(const_frame1_ptr->video_frame_buffer()->DataY() ==
- const_frame2_ptr->video_frame_buffer()->DataY());
- EXPECT_TRUE(const_frame1_ptr->video_frame_buffer()->DataU() ==
- const_frame2_ptr->video_frame_buffer()->DataU());
- EXPECT_TRUE(const_frame1_ptr->video_frame_buffer()->DataV() ==
- const_frame2_ptr->video_frame_buffer()->DataV());
+ VideoFrame frame2(frame1);
+
+ EXPECT_TRUE(frame1.video_frame_buffer()->DataY() ==
+ frame2.video_frame_buffer()->DataY());
+ EXPECT_TRUE(frame1.video_frame_buffer()->DataU() ==
+ frame2.video_frame_buffer()->DataU());
+ EXPECT_TRUE(frame1.video_frame_buffer()->DataV() ==
+ frame2.video_frame_buffer()->DataV());
EXPECT_EQ(frame2.timestamp(), frame1.timestamp());
EXPECT_EQ(frame2.ntp_time_ms(), frame1.ntp_time_ms());
« no previous file with comments | « no previous file | webrtc/common_video/video_frame.cc » ('j') | webrtc/modules/video_processing/test/video_processing_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698