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

Unified Diff: media/base/pipeline_impl_unittest.cc

Issue 2239243002: Interpolate media time for mojo rendering pipeline. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: moves media-time clamping to PipelineImpl Created 4 years, 3 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/base/time_delta_interpolator.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
diff --git a/media/base/pipeline_impl_unittest.cc b/media/base/pipeline_impl_unittest.cc
index 942d5432990fe651525d21e341862c2e9143e1b7..a654c12040c00bc83af05c0a32887e248b3ca46a 100644
--- a/media/base/pipeline_impl_unittest.cc
+++ b/media/base/pipeline_impl_unittest.cc
@@ -806,6 +806,26 @@ TEST_F(PipelineImplTest, PositiveStartTime) {
base::RunLoop().RunUntilIdle();
}
+TEST_F(PipelineImplTest, GetMediaTime) {
+ CreateAudioStream();
+ MockDemuxerStreamVector streams;
+ streams.push_back(audio_stream());
+ SetDemuxerExpectations(&streams);
+ SetRendererExpectations();
+ StartPipelineAndExpect(PIPELINE_OK);
+
+ // Pipeline should report the same media time returned by the renderer.
+ base::TimeDelta kMediaTime = base::TimeDelta::FromSeconds(2);
+ EXPECT_CALL(*renderer_, GetMediaTime()).WillRepeatedly(Return(kMediaTime));
+ EXPECT_EQ(kMediaTime, pipeline_->GetMediaTime());
+
+ // Media time should not go backwards even if the renderer returns an
+ // errorneous value. PipelineImpl should clamp it to last reported value.
+ EXPECT_CALL(*renderer_, GetMediaTime())
+ .WillRepeatedly(Return(base::TimeDelta::FromSeconds(1)));
+ EXPECT_EQ(kMediaTime, pipeline_->GetMediaTime());
+}
+
class PipelineTeardownTest : public PipelineImplTest {
public:
enum TeardownState {
« no previous file with comments | « media/base/pipeline_impl.cc ('k') | media/base/time_delta_interpolator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698