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

Unified Diff: media/base/pipeline_unittest.cc

Issue 10915003: Remove Pipeline::has_{audio,video}_ members. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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/base/pipeline.cc ('K') | « media/base/pipeline.cc ('k') | no next file » | 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 a91ad322802c14bc4b45e69544bcfb9395131916..c37950e2ec5ef64d6f9e4e49f5a6f388597d06ee 100644
--- a/media/base/pipeline_unittest.cc
+++ b/media/base/pipeline_unittest.cc
@@ -94,7 +94,8 @@ class PipelineTest : public ::testing::Test {
public:
PipelineTest()
: pipeline_(new Pipeline(message_loop_.message_loop_proxy(),
- new MediaLog())) {
+ new MediaLog())),
+ audio_disabled_(false) {
mocks_.reset(new MockFilterCollection());
// InitializeDemuxer() adds overriding expectations for expected non-NULL
@@ -115,7 +116,7 @@ class PipelineTest : public ::testing::Test {
// TODO(scherkus): Don't pause+flush on shutdown,
// see http://crbug.com/110228
- if (audio_stream_) {
+ if (audio_stream_ && !audio_disabled_) {
EXPECT_CALL(*mocks_->audio_renderer(), Pause(_))
.WillOnce(RunClosure());
EXPECT_CALL(*mocks_->audio_renderer(), Flush(_))
@@ -203,6 +204,7 @@ class PipelineTest : public ::testing::Test {
_, _, _, _, _, _))
.WillOnce(DoAll(RunPipelineStatusCB(),
WithArg<5>(RunClosure()))); // |disabled_cb|.
+ audio_disabled_ = true;
} else {
EXPECT_CALL(*mocks_->audio_renderer(), Initialize(
scoped_refptr<AudioDecoder>(mocks_->audio_decoder()),
@@ -221,7 +223,7 @@ class PipelineTest : public ::testing::Test {
EXPECT_CALL(callbacks_, OnBufferingState(Pipeline::kHaveMetadata));
EXPECT_CALL(*mocks_->demuxer(), SetPlaybackRate(0.0f));
- if (audio_stream_) {
+ if (audio_stream_ && !audio_disabled_) {
EXPECT_CALL(*mocks_->audio_renderer(), SetPlaybackRate(0.0f));
EXPECT_CALL(*mocks_->audio_renderer(), SetVolume(1.0f));
@@ -306,6 +308,11 @@ class PipelineTest : public ::testing::Test {
EXPECT_EQ(seek_time, pipeline_->GetMediaTime());
}
+ void DisableAudio() {
+ pipeline_->OnAudioDisabled();
+ audio_disabled_ = true;
+ }
+
// Fixture members.
StrictMock<CallbackHelper> callbacks_;
MessageLoop message_loop_;
@@ -313,6 +320,7 @@ class PipelineTest : public ::testing::Test {
scoped_ptr<media::MockFilterCollection> mocks_;
scoped_refptr<StrictMock<MockDemuxerStream> > audio_stream_;
scoped_refptr<StrictMock<MockDemuxerStream> > video_stream_;
+ bool audio_disabled_;
AudioRenderer::TimeCB audio_time_cb_;
VideoDecoderConfig video_decoder_config_;
@@ -581,7 +589,7 @@ TEST_F(PipelineTest, DisableAudioRenderer) {
EXPECT_TRUE(pipeline_->HasVideo());
EXPECT_CALL(*mocks_->demuxer(), OnAudioRendererDisabled());
- pipeline_->OnAudioDisabled();
+ DisableAudio();
// Verify that ended event is fired when video ends.
EXPECT_CALL(callbacks_, OnEnded(PIPELINE_OK));
« media/base/pipeline.cc ('K') | « media/base/pipeline.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698