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

Unified Diff: remoting/client/software_video_renderer_unittest.cc

Issue 1864213002: Convert //remoting to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Mac IWYU Created 4 years, 8 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 | « remoting/client/software_video_renderer.cc ('k') | remoting/codec/audio_decoder.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/software_video_renderer_unittest.cc
diff --git a/remoting/client/software_video_renderer_unittest.cc b/remoting/client/software_video_renderer_unittest.cc
index 9b658fdb325e39ef3d33e8d2d0bc71e6349f739d..6ad198658e165c59b63f3fd1a08be9f8f02c253f 100644
--- a/remoting/client/software_video_renderer_unittest.cc
+++ b/remoting/client/software_video_renderer_unittest.cc
@@ -10,6 +10,7 @@
#include <vector>
#include "base/bind.h"
+#include "base/memory/ptr_util.h"
#include "base/memory/scoped_vector.h"
#include "base/message_loop/message_loop.h"
#include "base/run_loop.h"
@@ -35,7 +36,8 @@ class TestFrameConsumer : public protocol::FrameConsumer {
TestFrameConsumer() {}
~TestFrameConsumer() override {}
- scoped_ptr<DesktopFrame> WaitForNextFrame(base::Closure* out_done_callback) {
+ std::unique_ptr<DesktopFrame> WaitForNextFrame(
+ base::Closure* out_done_callback) {
EXPECT_TRUE(thread_checker_.CalledOnValidThread());
frame_run_loop_.reset(new base::RunLoop());
frame_run_loop_->Run();
@@ -46,13 +48,13 @@ class TestFrameConsumer : public protocol::FrameConsumer {
}
// FrameConsumer interface.
- scoped_ptr<DesktopFrame> AllocateFrame(
+ std::unique_ptr<DesktopFrame> AllocateFrame(
const webrtc::DesktopSize& size) override {
EXPECT_TRUE(thread_checker_.CalledOnValidThread());
- return make_scoped_ptr(new webrtc::BasicDesktopFrame(size));
+ return base::WrapUnique(new webrtc::BasicDesktopFrame(size));
}
- void DrawFrame(scoped_ptr<DesktopFrame> frame,
+ void DrawFrame(std::unique_ptr<DesktopFrame> frame,
const base::Closure& done) override {
EXPECT_TRUE(thread_checker_.CalledOnValidThread());
last_frame_ = std::move(frame);
@@ -68,14 +70,14 @@ class TestFrameConsumer : public protocol::FrameConsumer {
private:
base::ThreadChecker thread_checker_;
- scoped_ptr<base::RunLoop> frame_run_loop_;
+ std::unique_ptr<base::RunLoop> frame_run_loop_;
- scoped_ptr<DesktopFrame> last_frame_;
+ std::unique_ptr<DesktopFrame> last_frame_;
base::Closure last_frame_done_callback_;
};
-scoped_ptr<DesktopFrame> CreateTestFrame(int index) {
- scoped_ptr<DesktopFrame> frame(new webrtc::BasicDesktopFrame(
+std::unique_ptr<DesktopFrame> CreateTestFrame(int index) {
+ std::unique_ptr<DesktopFrame> frame(new webrtc::BasicDesktopFrame(
webrtc::DesktopSize(kFrameWidth, kFrameHeight)));
for (int y = 0; y < kFrameHeight; y++) {
@@ -145,7 +147,7 @@ class SoftwareVideoRendererTest : public ::testing::Test {
base::Thread decode_thread_;
TestFrameConsumer frame_consumer_;
- scoped_ptr<SoftwareVideoRenderer> renderer_;
+ std::unique_ptr<SoftwareVideoRenderer> renderer_;
VideoEncoderVerbatim encoder_;
};
@@ -170,7 +172,7 @@ TEST_F(SoftwareVideoRendererTest, DecodeFrame) {
for (int frame_index = 0; frame_index < kFrameCount; frame_index++) {
base::Closure done_callback;
- scoped_ptr<DesktopFrame> decoded_frame =
+ std::unique_ptr<DesktopFrame> decoded_frame =
frame_consumer_.WaitForNextFrame(&done_callback);
EXPECT_FALSE(callback_called[frame_index]);
« no previous file with comments | « remoting/client/software_video_renderer.cc ('k') | remoting/codec/audio_decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698