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

Unified Diff: media/filters/ffmpeg_video_decoder_unittest.cc

Issue 155469: Splitting media filter's Initialize() into Create() + callback and Seek() + callback. (Closed)
Patch Set: Fixed valgrind errors Created 11 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/ffmpeg_demuxer_unittest.cc ('k') | media/filters/file_data_source.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/ffmpeg_video_decoder_unittest.cc
diff --git a/media/filters/ffmpeg_video_decoder_unittest.cc b/media/filters/ffmpeg_video_decoder_unittest.cc
index b4d4ace1ffd905065e658ec2ab84db3725e1805d..407f6850af538dcf63cf3ca80fb5ec0cfc727065 100644
--- a/media/filters/ffmpeg_video_decoder_unittest.cc
+++ b/media/filters/ffmpeg_video_decoder_unittest.cc
@@ -118,6 +118,7 @@ class FFmpegVideoDecoderTest : public testing::Test {
scoped_refptr<DataBuffer> buffer_;
scoped_refptr<DataBuffer> end_of_stream_buffer_;
StrictMock<MockFilterHost> host_;
+ StrictMock<MockFilterCallback> callback_;
MessageLoop message_loop_;
// FFmpeg fixtures.
@@ -162,8 +163,10 @@ TEST_F(FFmpegVideoDecoderTest, Initialize_QueryInterfaceFails) {
EXPECT_CALL(*demuxer_, QueryInterface(AVStreamProvider::interface_id()))
.WillOnce(ReturnNull());
EXPECT_CALL(host_, Error(PIPELINE_ERROR_DECODE));
+ EXPECT_CALL(callback_, OnFilterCallback());
+ EXPECT_CALL(callback_, OnCallbackDestroyed());
- EXPECT_TRUE(decoder_->Initialize(demuxer_));
+ decoder_->Initialize(demuxer_, callback_.NewCallback());
message_loop_.RunAllPending();
}
@@ -177,8 +180,10 @@ TEST_F(FFmpegVideoDecoderTest, Initialize_FindDecoderFails) {
EXPECT_CALL(*MockFFmpeg::get(), AVCodecFindDecoder(CODEC_ID_NONE))
.WillOnce(ReturnNull());
EXPECT_CALL(host_, Error(PIPELINE_ERROR_DECODE));
+ EXPECT_CALL(callback_, OnFilterCallback());
+ EXPECT_CALL(callback_, OnCallbackDestroyed());
- EXPECT_TRUE(decoder_->Initialize(demuxer_));
+ decoder_->Initialize(demuxer_, callback_.NewCallback());
message_loop_.RunAllPending();
}
@@ -194,8 +199,10 @@ TEST_F(FFmpegVideoDecoderTest, Initialize_InitThreadFails) {
EXPECT_CALL(*MockFFmpeg::get(), AVCodecThreadInit(&codec_context_, 2))
.WillOnce(Return(-1));
EXPECT_CALL(host_, Error(PIPELINE_ERROR_DECODE));
+ EXPECT_CALL(callback_, OnFilterCallback());
+ EXPECT_CALL(callback_, OnCallbackDestroyed());
- EXPECT_TRUE(decoder_->Initialize(demuxer_));
+ decoder_->Initialize(demuxer_, callback_.NewCallback());
message_loop_.RunAllPending();
}
@@ -213,8 +220,10 @@ TEST_F(FFmpegVideoDecoderTest, Initialize_OpenDecoderFails) {
EXPECT_CALL(*MockFFmpeg::get(), AVCodecOpen(&codec_context_, &codec_))
.WillOnce(Return(-1));
EXPECT_CALL(host_, Error(PIPELINE_ERROR_DECODE));
+ EXPECT_CALL(callback_, OnFilterCallback());
+ EXPECT_CALL(callback_, OnCallbackDestroyed());
- EXPECT_TRUE(decoder_->Initialize(demuxer_));
+ decoder_->Initialize(demuxer_, callback_.NewCallback());
message_loop_.RunAllPending();
}
@@ -231,9 +240,10 @@ TEST_F(FFmpegVideoDecoderTest, Initialize_Successful) {
.WillOnce(Return(0));
EXPECT_CALL(*MockFFmpeg::get(), AVCodecOpen(&codec_context_, &codec_))
.WillOnce(Return(0));
- EXPECT_CALL(host_, InitializationComplete());
+ EXPECT_CALL(callback_, OnFilterCallback());
+ EXPECT_CALL(callback_, OnCallbackDestroyed());
- EXPECT_TRUE(decoder_->Initialize(demuxer_));
+ decoder_->Initialize(demuxer_, callback_.NewCallback());
message_loop_.RunAllPending();
// Test that the output media format is an uncompressed video surface that
« no previous file with comments | « media/filters/ffmpeg_demuxer_unittest.cc ('k') | media/filters/file_data_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698