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

Unified Diff: media/filters/ffmpeg_demuxer_unittest.cc

Issue 9968117: Move Demuxer::set_host() to Initialize(). (Closed) Base URL: svn://chrome-svn/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
« media/filters/ffmpeg_demuxer.cc ('K') | « media/filters/ffmpeg_demuxer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/ffmpeg_demuxer_unittest.cc
diff --git a/media/filters/ffmpeg_demuxer_unittest.cc b/media/filters/ffmpeg_demuxer_unittest.cc
index 520b59bf1bd349fc1520613998e7b58f0efb9ea3..b988e84db3cfd8aef08194e9c6da02e69d91d592 100644
--- a/media/filters/ffmpeg_demuxer_unittest.cc
+++ b/media/filters/ffmpeg_demuxer_unittest.cc
@@ -72,16 +72,13 @@ class FFmpegDemuxerTest : public testing::Test {
// Create an FFmpegDemuxer with local data source.
demuxer_ = new FFmpegDemuxer(&message_loop_, data_source_, true);
demuxer_->disable_first_seek_hack_for_testing();
-
- // Inject a filter host and message loop and prepare a data source.
- demuxer_->set_host(&host_);
}
MOCK_METHOD1(CheckPoint, void(int v));
void InitializeDemuxer() {
EXPECT_CALL(host_, SetDuration(_));
- demuxer_->Initialize(NewExpectedStatusCB(PIPELINE_OK));
+ demuxer_->Initialize(&host_, NewExpectedStatusCB(PIPELINE_OK));
message_loop_.RunAllPending();
}
@@ -149,7 +146,8 @@ TEST_F(FFmpegDemuxerTest, Initialize_OpenFails) {
// Simulate avformat_open_input() failing.
CreateDemuxer("ten_byte_file"),
EXPECT_CALL(host_, SetCurrentReadPosition(_));
- demuxer_->Initialize(NewExpectedStatusCB(DEMUXER_ERROR_COULD_NOT_OPEN));
+ demuxer_->Initialize(
+ &host_, NewExpectedStatusCB(DEMUXER_ERROR_COULD_NOT_OPEN));
message_loop_.RunAllPending();
}
@@ -160,7 +158,7 @@ TEST_F(FFmpegDemuxerTest, Initialize_OpenFails) {
//TEST_F(FFmpegDemuxerTest, Initialize_ParseFails) {
// CreateDemuxer("find_stream_info_fail.webm");
// demuxer_->Initialize(
-// NewExpectedStatusCB(DEMUXER_ERROR_COULD_NOT_PARSE));
+// &host_, NewExpectedStatusCB(DEMUXER_ERROR_COULD_NOT_PARSE));
// message_loop_.RunAllPending();
//}
@@ -169,7 +167,7 @@ TEST_F(FFmpegDemuxerTest, Initialize_NoStreams) {
CreateDemuxer("no_streams.webm");
EXPECT_CALL(host_, SetCurrentReadPosition(_));
demuxer_->Initialize(
- NewExpectedStatusCB(DEMUXER_ERROR_NO_SUPPORTED_STREAMS));
+ &host_, NewExpectedStatusCB(DEMUXER_ERROR_NO_SUPPORTED_STREAMS));
message_loop_.RunAllPending();
}
@@ -177,7 +175,7 @@ TEST_F(FFmpegDemuxerTest, Initialize_NoAudioVideo) {
// Open a file containing streams but none of which are audio/video streams.
CreateDemuxer("no_audio_video.webm");
demuxer_->Initialize(
- NewExpectedStatusCB(DEMUXER_ERROR_NO_SUPPORTED_STREAMS));
+ &host_, NewExpectedStatusCB(DEMUXER_ERROR_NO_SUPPORTED_STREAMS));
message_loop_.RunAllPending();
}
@@ -586,10 +584,11 @@ TEST_F(FFmpegDemuxerTest, ProtocolRead) {
EXPECT_CALL(*data_source, Stop(_))
.WillRepeatedly(Invoke(&RunStopFilterCallback));
- // Creates a demuxer.
+ // Create a demuxer.
scoped_refptr<MockFFmpegDemuxer> demuxer(
new MockFFmpegDemuxer(&message_loop_, data_source));
- demuxer->set_host(&host_);
+ demuxer->Initialize(&host_, NewExpectedStatusCB(PIPELINE_OK));
acolwell GONE FROM CHROMIUM 2012/04/04 16:01:00 what?! Initialize() wasn't necessary before? Seems
scherkus (not reviewing) 2012/04/05 01:54:53 DCHECK(host_) added and rewrote these tests
+ message_loop_.RunAllPending();
uint8 kBuffer[1];
InSequence s;
« media/filters/ffmpeg_demuxer.cc ('K') | « media/filters/ffmpeg_demuxer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698