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

Unified Diff: media/filters/video_renderer_base_unittest.cc

Issue 2101022: refactoring decoder interface (Closed)
Patch Set: q Created 10 years, 7 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_renderer_base.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/video_renderer_base_unittest.cc
diff --git a/media/filters/video_renderer_base_unittest.cc b/media/filters/video_renderer_base_unittest.cc
index 2cdde22717ab2085772478483fdd8b3ec2146472..111df56710f33e4dfbbc8d276e0ea76cfe644024 100644
--- a/media/filters/video_renderer_base_unittest.cc
+++ b/media/filters/video_renderer_base_unittest.cc
@@ -48,7 +48,7 @@ class VideoRendererBaseTest : public ::testing::Test {
renderer_->set_host(&host_);
// Queue all reads from the decoder.
- EXPECT_CALL(*decoder_, Read(NotNull()))
+ EXPECT_CALL(*decoder_, FillThisBuffer(_))
.WillRepeatedly(Invoke(this, &VideoRendererBaseTest::EnqueueCallback));
// Sets the essential media format keys for this decoder.
@@ -61,7 +61,7 @@ class VideoRendererBaseTest : public ::testing::Test {
}
virtual ~VideoRendererBaseTest() {
- STLDeleteElements(&read_queue_);
+ read_queue_.clear();
// Expect a call into the subclass.
EXPECT_CALL(*renderer_, OnStop());
@@ -79,12 +79,12 @@ class VideoRendererBaseTest : public ::testing::Test {
StrictMock<MockFilterCallback> callback_;
MediaFormat decoder_media_format_;
- // Receives asynchronous read requests sent to |decoder_|.
- std::deque<Callback1<VideoFrame*>::Type*> read_queue_;
+ // Receives all the buffers that renderer had provided to |decoder_|.
+ std::deque<scoped_refptr<VideoFrame> > read_queue_;
private:
- void EnqueueCallback(Callback1<VideoFrame*>::Type* callback) {
- read_queue_.push_back(callback);
+ void EnqueueCallback(scoped_refptr<VideoFrame> frame) {
+ read_queue_.push_back(frame);
}
DISALLOW_COPY_AND_ASSIGN(VideoRendererBaseTest);
@@ -191,8 +191,7 @@ TEST_F(VideoRendererBaseTest, Initialize_Successful) {
scoped_refptr<VideoFrame> frame;
VideoFrame::CreateFrame(VideoFrame::RGB32, kWidth, kHeight, kZero,
kZero, &frame);
- read_queue_.front()->Run(frame);
- delete read_queue_.front();
+ decoder_->fill_buffer_done_callback()->Run(frame);
read_queue_.pop_front();
}
}
« no previous file with comments | « media/filters/video_renderer_base.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698