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

Unified Diff: media/filters/video_frame_stream_unittest.cc

Issue 12989009: Remove reference counting from media::VideoDecoder and friends. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 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 | « media/filters/video_frame_stream.cc ('k') | media/filters/video_renderer_base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/video_frame_stream_unittest.cc
diff --git a/media/filters/video_frame_stream_unittest.cc b/media/filters/video_frame_stream_unittest.cc
index e45c90355304b868c42a378f9001aa22481772bf..7c58b6eb7897fcba7da455e2e3442020567a4950 100644
--- a/media/filters/video_frame_stream_unittest.cc
+++ b/media/filters/video_frame_stream_unittest.cc
@@ -31,18 +31,21 @@ static const gfx::Size kNaturalSize(320, 240);
class VideoFrameStreamTest : public testing::TestWithParam<bool> {
public:
VideoFrameStreamTest()
- : video_frame_stream_(new VideoFrameStream(
- message_loop_.message_loop_proxy(),
- base::Bind(&VideoFrameStreamTest::SetDecryptorReadyCallback,
- base::Unretained(this)))),
- video_config_(kCodecVP8, VIDEO_CODEC_PROFILE_UNKNOWN, kVideoFormat,
+ : video_config_(kCodecVP8, VIDEO_CODEC_PROFILE_UNKNOWN, kVideoFormat,
kCodedSize, kVisibleRect, kNaturalSize, NULL, 0,
GetParam()),
demuxer_stream_(new StrictMock<MockDemuxerStream>()),
decryptor_(new NiceMock<MockDecryptor>()),
decoder_(new StrictMock<MockVideoDecoder>()),
is_initialized_(false) {
- decoders_.push_back(decoder_);
+ ScopedVector<VideoDecoder> decoders;
+ decoders.push_back(decoder_);
+
+ video_frame_stream_ = new VideoFrameStream(
+ message_loop_.message_loop_proxy(),
+ decoders.Pass(),
+ base::Bind(&VideoFrameStreamTest::SetDecryptorReadyCallback,
+ base::Unretained(this)));
EXPECT_CALL(*demuxer_stream_, type())
.WillRepeatedly(Return(DemuxerStream::VIDEO));
@@ -88,7 +91,6 @@ class VideoFrameStreamTest : public testing::TestWithParam<bool> {
.WillOnce(SaveArg<1>(&decoder_init_cb_));
video_frame_stream_->Initialize(
demuxer_stream_,
- decoders_,
base::Bind(&VideoFrameStreamTest::OnStatistics, base::Unretained(this)),
base::Bind(&VideoFrameStreamTest::OnInitialized,
base::Unretained(this)));
@@ -188,8 +190,7 @@ class VideoFrameStreamTest : public testing::TestWithParam<bool> {
// Use NiceMock since we don't care about most of calls on the decryptor, e.g.
// RegisterNewKeyCB().
scoped_ptr<NiceMock<MockDecryptor> > decryptor_;
- scoped_refptr<StrictMock<MockVideoDecoder> > decoder_;
- VideoFrameStream::VideoDecoderList decoders_;
+ StrictMock<MockVideoDecoder>* decoder_; // Owned by |video_frame_stream_|.
// Callbacks to simulate pending decoder operations.
PipelineStatusCB decoder_init_cb_;
« no previous file with comments | « media/filters/video_frame_stream.cc ('k') | media/filters/video_renderer_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698