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

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

Issue 2550453004: Avoid using the VideoFrame default constructor. (Closed)
Patch Set: Use base::Optional instead of rtc::Optional. 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..45c52dd9fa8a8b1ed3fd11b96b5eba7b48c98613 100644
--- a/content/renderer/media/webrtc/webrtc_video_capturer_adapter_unittest.cc
+++ b/content/renderer/media/webrtc/webrtc_video_capturer_adapter_unittest.cc
@@ -5,6 +5,7 @@
#include <algorithm>
#include "base/bind.h"
+#include "base/optional.h"
#include "base/run_loop.h"
#include "content/child/child_process.h"
#include "content/renderer/media/webrtc/webrtc_video_capturer_adapter.h"
@@ -62,8 +63,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 +80,7 @@ class WebRtcVideoCapturerAdapterTest
// rtc::VideoSinkInterface
void OnFrame(const webrtc::VideoFrame& frame) override {
- output_frame_ = frame;
+ output_frame_ = base::Optional<webrtc::VideoFrame>(frame);
output_frame_width_ = frame.width();
output_frame_height_ = frame.height();
}
@@ -88,8 +90,7 @@ class WebRtcVideoCapturerAdapterTest
const ChildProcess child_process_;
WebRtcVideoCapturerAdapter adapter_;
- // TODO(nisse): Default constructor is deprecated. Use std::optional?
- webrtc::VideoFrame output_frame_;
+ base::Optional<webrtc::VideoFrame> output_frame_;
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