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

Unified Diff: content/renderer/media/webrtc/webrtc_video_capturer_adapter_unittest.cc

Issue 2550453004: Avoid using the VideoFrame default constructor. (Closed)
Patch Set: Created 4 years 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/webrtc/webrtc_video_capturer_adapter_unittest.cc
diff --git a/content/renderer/media/webrtc/webrtc_video_capturer_adapter_unittest.cc b/content/renderer/media/webrtc/webrtc_video_capturer_adapter_unittest.cc
index afdafeb70af2f1c0cd9a369e8d33d9a62c44f2bc..963e4ca05ac28168e212a208046e3ba52108e6e3 100644
--- a/content/renderer/media/webrtc/webrtc_video_capturer_adapter_unittest.cc
+++ b/content/renderer/media/webrtc/webrtc_video_capturer_adapter_unittest.cc
@@ -62,8 +62,9 @@ class WebRtcVideoCapturerAdapterTest
gfx::Size(10, 10), gfx::Rect(10, 10), gfx::Size(10, 10),
base::TimeDelta());
adapter_.OnFrameCaptured(frame);
+ ASSERT_TRUE(output_frame_);
rtc::scoped_refptr<webrtc::VideoFrameBuffer> texture_frame =
- output_frame_.video_frame_buffer();
+ output_frame_->video_frame_buffer();
EXPECT_EQ(media::VideoFrame::STORAGE_OPAQUE,
static_cast<media::VideoFrame*>(texture_frame->native_handle())
->storage_type());
@@ -78,7 +79,7 @@ class WebRtcVideoCapturerAdapterTest
// rtc::VideoSinkInterface
void OnFrame(const webrtc::VideoFrame& frame) override {
- output_frame_ = frame;
+ output_frame_ = rtc::Optional<webrtc::VideoFrame>(frame);
output_frame_width_ = frame.width();
output_frame_height_ = frame.height();
}
@@ -88,8 +89,7 @@ class WebRtcVideoCapturerAdapterTest
const ChildProcess child_process_;
WebRtcVideoCapturerAdapter adapter_;
- // TODO(nisse): Default constructor is deprecated. Use std::optional?
- webrtc::VideoFrame output_frame_;
+ rtc::Optional<webrtc::VideoFrame> output_frame_;
Sergey Ulanov 2016/12/02 18:24:05 This this test is in chromium I think it's better
nisse-chromium (ooo August 14) 2016/12/05 09:54:35 Done.
int output_frame_width_;
int output_frame_height_;
};
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698