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

Unified Diff: media/filters/video_renderer_base_unittest.cc

Issue 16274005: Separate DemuxerStream and VideoDecoder. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix win64 Created 7 years, 5 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_unittest.cc ('k') | media/filters/vpx_video_decoder.h » ('j') | 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 8044a11d06499f5a6861097e672e31722bdbeaa1..8e6dfb760cf58f74c3b696e60126a1126a4c9137 100644
--- a/media/filters/video_renderer_base_unittest.cc
+++ b/media/filters/video_renderer_base_unittest.cc
@@ -2,6 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include <utility>
+
#include "base/bind.h"
#include "base/callback.h"
#include "base/callback_helpers.h"
@@ -24,6 +26,7 @@ using ::testing::_;
using ::testing::AnyNumber;
using ::testing::InSequence;
using ::testing::Invoke;
+using ::testing::NiceMock;
using ::testing::NotNull;
using ::testing::Return;
using ::testing::StrictMock;
@@ -52,6 +55,9 @@ class VideoRendererBaseTest : public ::testing::Test {
demuxer_stream_.set_video_decoder_config(TestVideoConfig::Normal());
// We expect these to be called but we don't care how/when.
+ EXPECT_CALL(demuxer_stream_, Read(_))
+ .WillRepeatedly(RunCallback<0>(DemuxerStream::kOk,
+ DecoderBuffer::CreateEOSBuffer()));
EXPECT_CALL(*decoder_, Stop(_))
.WillRepeatedly(Invoke(this, &VideoRendererBaseTest::StopRequested));
EXPECT_CALL(statistics_cb_object_, OnStatistics(_))
@@ -78,8 +84,8 @@ class VideoRendererBaseTest : public ::testing::Test {
void InitializeWithDuration(int duration_ms) {
duration_ = base::TimeDelta::FromMilliseconds(duration_ms);
- // Monitor reads from the decoder.
- EXPECT_CALL(*decoder_, Read(_))
+ // Monitor decodes from the decoder.
+ EXPECT_CALL(*decoder_, Decode(_, _))
.WillRepeatedly(Invoke(this, &VideoRendererBaseTest::FrameRequested));
EXPECT_CALL(*decoder_, Reset(_))
@@ -289,7 +295,7 @@ class VideoRendererBaseTest : public ::testing::Test {
// Fixture members.
scoped_ptr<VideoRendererBase> renderer_;
MockVideoDecoder* decoder_; // Owned by |renderer_|.
- MockDemuxerStream demuxer_stream_;
+ NiceMock<MockDemuxerStream> demuxer_stream_;
MockStatisticsCB statistics_cb_object_;
private:
@@ -307,7 +313,8 @@ class VideoRendererBaseTest : public ::testing::Test {
current_frame_ = frame;
}
- void FrameRequested(const VideoDecoder::ReadCB& read_cb) {
+ void FrameRequested(const scoped_refptr<DecoderBuffer>& buffer,
+ const VideoDecoder::ReadCB& read_cb) {
DCHECK_EQ(&message_loop_, base::MessageLoop::current());
CHECK(read_cb_.is_null());
read_cb_ = read_cb;
« no previous file with comments | « media/filters/video_frame_stream_unittest.cc ('k') | media/filters/vpx_video_decoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698