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

Unified Diff: remoting/protocol/rtp_video_writer_unittest.cc

Issue 9827006: Refactor VideoStub interface to accept ownership of video packets. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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 | « remoting/protocol/rtp_video_writer.cc ('k') | remoting/protocol/video_stub.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/rtp_video_writer_unittest.cc
diff --git a/remoting/protocol/rtp_video_writer_unittest.cc b/remoting/protocol/rtp_video_writer_unittest.cc
index 90484b154447c8e106369ee3a29a9cc56b566ce3..bd1ba3c159247895132360475d7bca35aaf2fe1c 100644
--- a/remoting/protocol/rtp_video_writer_unittest.cc
+++ b/remoting/protocol/rtp_video_writer_unittest.cc
@@ -83,7 +83,7 @@ class RtpVideoWriterTest : public testing::Test {
void InitPacket(int size, bool first, bool last) {
InitData(size);
- packet_ = new VideoPacket();
+ packet_.reset(new VideoPacket());
packet_->mutable_format()->set_encoding(VideoPacketFormat::ENCODING_VP8);
if (first)
packet_->set_flags(packet_->flags() | VideoPacket::FIRST_PACKET);
@@ -126,13 +126,12 @@ class RtpVideoWriterTest : public testing::Test {
RtpVideoWriter writer_;
vector<char> data_;
- VideoPacket* packet_;
+ scoped_ptr<VideoPacket> packet_;
};
TEST_F(RtpVideoWriterTest, NotFragmented_FirstPacket) {
InitPacket(1024, true, false);
- writer_.ProcessVideoPacket(
- packet_, base::Bind(&base::DeletePointer<VideoPacket>, packet_));
+ writer_.ProcessVideoPacket(packet_.Pass(), base::Closure());
message_loop_.RunAllPending();
ExpectedPacket expected[] = {
@@ -143,8 +142,7 @@ TEST_F(RtpVideoWriterTest, NotFragmented_FirstPacket) {
TEST_F(RtpVideoWriterTest, NotFragmented_LastPackes) {
InitPacket(1024, false, true);
- writer_.ProcessVideoPacket(
- packet_, base::Bind(&base::DeletePointer<VideoPacket>, packet_));
+ writer_.ProcessVideoPacket(packet_.Pass(), base::Closure());
message_loop_.RunAllPending();
ExpectedPacket expected[] = {
@@ -155,8 +153,7 @@ TEST_F(RtpVideoWriterTest, NotFragmented_LastPackes) {
TEST_F(RtpVideoWriterTest, TwoFragments_FirstPacket) {
InitPacket(2000, true, false);
- writer_.ProcessVideoPacket(
- packet_, base::Bind(&base::DeletePointer<VideoPacket>, packet_));
+ writer_.ProcessVideoPacket(packet_.Pass(), base::Closure());
message_loop_.RunAllPending();
ExpectedPacket expected[] = {
@@ -168,8 +165,7 @@ TEST_F(RtpVideoWriterTest, TwoFragments_FirstPacket) {
TEST_F(RtpVideoWriterTest, TwoFragments_LastPacket) {
InitPacket(2000, false, true);
- writer_.ProcessVideoPacket(
- packet_, base::Bind(&base::DeletePointer<VideoPacket>, packet_));
+ writer_.ProcessVideoPacket(packet_.Pass(), base::Closure());
message_loop_.RunAllPending();
ExpectedPacket expected[] = {
@@ -181,8 +177,7 @@ TEST_F(RtpVideoWriterTest, TwoFragments_LastPacket) {
TEST_F(RtpVideoWriterTest, ThreeFragments) {
InitPacket(3000, true, true);
- writer_.ProcessVideoPacket(
- packet_, base::Bind(&base::DeletePointer<VideoPacket>, packet_));
+ writer_.ProcessVideoPacket(packet_.Pass(), base::Closure());
message_loop_.RunAllPending();
ExpectedPacket expected[] = {
« no previous file with comments | « remoting/protocol/rtp_video_writer.cc ('k') | remoting/protocol/video_stub.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698