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

Unified Diff: media/base/pipeline_unittest.cc

Issue 9325044: Remove AudioDecoder from the Filter heirarchy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: CR responses. Created 8 years, 10 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/base/pipeline_status.h ('k') | media/filters/audio_renderer_base.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/pipeline_unittest.cc
diff --git a/media/base/pipeline_unittest.cc b/media/base/pipeline_unittest.cc
index ead6d82b6cdc013084bceafd7d669e06d46ced06..8008f43ffa96862b440f15d21836d879ae250981 100644
--- a/media/base/pipeline_unittest.cc
+++ b/media/base/pipeline_unittest.cc
@@ -140,14 +140,9 @@ class PipelineTest : public ::testing::Test {
}
// Sets up expectations to allow the audio decoder to initialize.
- void InitializeAudioDecoder(MockDemuxerStream* stream) {
+ void InitializeAudioDecoder(const scoped_refptr<DemuxerStream>& stream) {
EXPECT_CALL(*mocks_->audio_decoder(), Initialize(stream, _, _))
.WillOnce(Invoke(&RunPipelineStatusCB3));
- EXPECT_CALL(*mocks_->audio_decoder(), SetPlaybackRate(0.0f));
- EXPECT_CALL(*mocks_->audio_decoder(), Seek(base::TimeDelta(), _))
- .WillOnce(Invoke(&RunFilterStatusCB));
- EXPECT_CALL(*mocks_->audio_decoder(), Stop(_))
- .WillOnce(Invoke(&RunStopFilterCallback));
}
// Sets up expectations to allow the video renderer to initialize.
@@ -166,13 +161,13 @@ class PipelineTest : public ::testing::Test {
// Sets up expectations to allow the audio renderer to initialize.
void InitializeAudioRenderer(bool disable_after_init_callback = false) {
if (disable_after_init_callback) {
- EXPECT_CALL(*mocks_->audio_renderer(),
- Initialize(mocks_->audio_decoder(), _, _, _))
+ EXPECT_CALL(*mocks_->audio_renderer(), Initialize(
+ scoped_refptr<AudioDecoder>(mocks_->audio_decoder()), _, _, _))
.WillOnce(DoAll(Invoke(&RunPipelineStatusCB4),
DisableAudioRenderer(mocks_->audio_renderer())));
} else {
- EXPECT_CALL(*mocks_->audio_renderer(),
- Initialize(mocks_->audio_decoder(), _, _, _))
+ EXPECT_CALL(*mocks_->audio_renderer(), Initialize(
+ scoped_refptr<AudioDecoder>(mocks_->audio_decoder()), _, _, _))
.WillOnce(Invoke(&RunPipelineStatusCB4));
}
EXPECT_CALL(*mocks_->audio_renderer(), SetPlaybackRate(0.0f));
@@ -232,8 +227,6 @@ class PipelineTest : public ::testing::Test {
.WillOnce(Invoke(&RunFilterStatusCB));
if (audio_stream_) {
- EXPECT_CALL(*mocks_->audio_decoder(), Seek(seek_time, _))
- .WillOnce(Invoke(&RunFilterStatusCB));
EXPECT_CALL(*mocks_->audio_renderer(), Seek(seek_time, _))
.WillOnce(Invoke(&RunFilterStatusCB));
}
@@ -573,8 +566,6 @@ TEST_F(PipelineTest, DisableAudioRenderer) {
.WillOnce(DisableAudioRenderer(mocks_->audio_renderer()));
EXPECT_CALL(*mocks_->demuxer(),
OnAudioRendererDisabled());
- EXPECT_CALL(*mocks_->audio_decoder(),
- OnAudioRendererDisabled());
EXPECT_CALL(*mocks_->audio_renderer(),
OnAudioRendererDisabled());
EXPECT_CALL(*mocks_->video_decoder(),
@@ -607,8 +598,6 @@ TEST_F(PipelineTest, DisableAudioRendererDuringInit) {
EXPECT_CALL(*mocks_->demuxer(),
OnAudioRendererDisabled());
- EXPECT_CALL(*mocks_->audio_decoder(),
- OnAudioRendererDisabled());
EXPECT_CALL(*mocks_->audio_renderer(),
OnAudioRendererDisabled());
EXPECT_CALL(*mocks_->video_decoder(),
@@ -700,7 +689,6 @@ TEST_F(PipelineTest, AudioStreamShorterThanVideo) {
float playback_rate = 1.0f;
EXPECT_CALL(*mocks_->demuxer(), SetPlaybackRate(playback_rate));
EXPECT_CALL(*mocks_->video_decoder(), SetPlaybackRate(playback_rate));
- EXPECT_CALL(*mocks_->audio_decoder(), SetPlaybackRate(playback_rate));
EXPECT_CALL(*mocks_->video_renderer(), SetPlaybackRate(playback_rate));
EXPECT_CALL(*mocks_->audio_renderer(), SetPlaybackRate(playback_rate));
pipeline_->SetPlaybackRate(playback_rate);
@@ -754,7 +742,6 @@ TEST_F(PipelineTest, ErrorDuringSeek) {
float playback_rate = 1.0f;
EXPECT_CALL(*mocks_->demuxer(), SetPlaybackRate(playback_rate));
- EXPECT_CALL(*mocks_->audio_decoder(), SetPlaybackRate(playback_rate));
EXPECT_CALL(*mocks_->audio_renderer(), SetPlaybackRate(playback_rate));
pipeline_->SetPlaybackRate(playback_rate);
message_loop_.RunAllPending();
« no previous file with comments | « media/base/pipeline_status.h ('k') | media/filters/audio_renderer_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698