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

Unified Diff: media/base/pipeline_impl_unittest.cc

Issue 159476: Merge 21611 - Implemented proper pausethenseek behaviour for the media pipeli... (Closed) Base URL: svn://chrome-svn/chrome/branches/195/src/
Patch Set: 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/base/pipeline_impl.cc ('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_impl_unittest.cc
===================================================================
--- media/base/pipeline_impl_unittest.cc (revision 21798)
+++ media/base/pipeline_impl_unittest.cc (working copy)
@@ -68,6 +68,8 @@
EXPECT_CALL(*mocks_->data_source(), Initialize("", NotNull()))
.WillOnce(Invoke(&RunFilterCallback));
EXPECT_CALL(*mocks_->data_source(), SetPlaybackRate(0.0f));
+ EXPECT_CALL(*mocks_->data_source(), Seek(base::TimeDelta(), NotNull()))
+ .WillOnce(Invoke(&RunFilterCallback));
EXPECT_CALL(*mocks_->data_source(), Stop());
}
@@ -80,6 +82,8 @@
EXPECT_CALL(*mocks_->demuxer(), GetNumberOfStreams())
.WillRepeatedly(Return(streams->size()));
EXPECT_CALL(*mocks_->demuxer(), SetPlaybackRate(0.0f));
+ EXPECT_CALL(*mocks_->demuxer(), Seek(base::TimeDelta(), NotNull()))
+ .WillOnce(Invoke(&RunFilterCallback));
EXPECT_CALL(*mocks_->demuxer(), Stop());
// Configure the demuxer to return the streams.
@@ -95,6 +99,8 @@
EXPECT_CALL(*mocks_->video_decoder(), Initialize(stream, NotNull()))
.WillOnce(Invoke(&RunFilterCallback));
EXPECT_CALL(*mocks_->video_decoder(), SetPlaybackRate(0.0f));
+ EXPECT_CALL(*mocks_->video_decoder(), Seek(base::TimeDelta(), NotNull()))
+ .WillOnce(Invoke(&RunFilterCallback));
EXPECT_CALL(*mocks_->video_decoder(), Stop());
}
@@ -103,6 +109,8 @@
EXPECT_CALL(*mocks_->audio_decoder(), Initialize(stream, NotNull()))
.WillOnce(Invoke(&RunFilterCallback));
EXPECT_CALL(*mocks_->audio_decoder(), SetPlaybackRate(0.0f));
+ EXPECT_CALL(*mocks_->audio_decoder(), Seek(base::TimeDelta(), NotNull()))
+ .WillOnce(Invoke(&RunFilterCallback));
EXPECT_CALL(*mocks_->audio_decoder(), Stop());
}
@@ -112,6 +120,8 @@
Initialize(mocks_->video_decoder(), NotNull()))
.WillOnce(Invoke(&RunFilterCallback));
EXPECT_CALL(*mocks_->video_renderer(), SetPlaybackRate(0.0f));
+ EXPECT_CALL(*mocks_->video_renderer(), Seek(base::TimeDelta(), NotNull()))
+ .WillOnce(Invoke(&RunFilterCallback));
EXPECT_CALL(*mocks_->video_renderer(), Stop());
}
@@ -122,6 +132,8 @@
.WillOnce(Invoke(&RunFilterCallback));
EXPECT_CALL(*mocks_->audio_renderer(), SetPlaybackRate(0.0f));
EXPECT_CALL(*mocks_->audio_renderer(), SetVolume(1.0f));
+ EXPECT_CALL(*mocks_->audio_renderer(), Seek(base::TimeDelta(), NotNull()))
+ .WillOnce(Invoke(&RunFilterCallback));
EXPECT_CALL(*mocks_->audio_renderer(), Stop());
}
@@ -356,7 +368,11 @@
pipeline_->Seek(expected,
NewCallback(reinterpret_cast<CallbackHelper*>(&callbacks_),
&CallbackHelper::OnSeek));
+
+ // We expect the time to be updated only after the seek has completed.
+ EXPECT_TRUE(expected != pipeline_->GetCurrentTime());
message_loop_.RunAllPending();
+ EXPECT_TRUE(expected == pipeline_->GetCurrentTime());
}
TEST_F(PipelineImplTest, SetVolume) {
Property changes on: media\base\pipeline_impl_unittest.cc
___________________________________________________________________
Modified: svn:mergeinfo
Merged /trunk/src/media/base/pipeline_impl_unittest.cc:r21611
« no previous file with comments | « media/base/pipeline_impl.cc ('k') | media/filters/audio_renderer_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698