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

Unified Diff: media/base/pipeline_unittest.cc

Issue 335273002: Fix seeking when the start time is non-zero. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments. Created 6 years, 6 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.cc ('k') | media/filters/chunk_demuxer.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 45cc73ba36fa7b1a46c5f19aed717b78da5be1fe..05ffc8c391a3918514b9b5a895b36226a2b8f623 100644
--- a/media/base/pipeline_unittest.cc
+++ b/media/base/pipeline_unittest.cc
@@ -107,9 +107,6 @@ class PipelineTest : public ::testing::Test {
EXPECT_CALL(*demuxer_, GetStream(_))
.WillRepeatedly(Return(null_pointer));
- EXPECT_CALL(*demuxer_, GetStartTime())
- .WillRepeatedly(Return(base::TimeDelta()));
-
EXPECT_CALL(*demuxer_, GetTimelineOffset())
.WillRepeatedly(Return(base::Time()));
@@ -174,7 +171,7 @@ class PipelineTest : public ::testing::Test {
EXPECT_CALL(*video_renderer_, SetPlaybackRate(0.0f));
// Startup sequence.
- EXPECT_CALL(*video_renderer_, Preroll(demuxer_->GetStartTime(), _))
+ EXPECT_CALL(*video_renderer_, Preroll(base::TimeDelta(), _))
.WillOnce(RunCallback<1>(PIPELINE_OK));
EXPECT_CALL(*video_renderer_, Play(_))
.WillOnce(RunClosure<0>());
@@ -739,43 +736,6 @@ TEST_F(PipelineTest, NoMessageDuringTearDownFromError) {
message_loop_.RunUntilIdle();
}
-TEST_F(PipelineTest, StartTimeIsZero) {
- CreateVideoStream();
- MockDemuxerStreamVector streams;
- streams.push_back(video_stream());
-
- const base::TimeDelta kDuration = base::TimeDelta::FromSeconds(100);
- InitializeDemuxer(&streams, kDuration);
- InitializeVideoRenderer(video_stream());
-
- InitializePipeline(PIPELINE_OK);
- EXPECT_FALSE(metadata_.has_audio);
- EXPECT_TRUE(metadata_.has_video);
-
- EXPECT_EQ(base::TimeDelta(), pipeline_->GetMediaTime());
-}
-
-TEST_F(PipelineTest, StartTimeIsNonZero) {
- const base::TimeDelta kStartTime = base::TimeDelta::FromSeconds(4);
- const base::TimeDelta kDuration = base::TimeDelta::FromSeconds(100);
-
- EXPECT_CALL(*demuxer_, GetStartTime())
- .WillRepeatedly(Return(kStartTime));
-
- CreateVideoStream();
- MockDemuxerStreamVector streams;
- streams.push_back(video_stream());
-
- InitializeDemuxer(&streams, kDuration);
- InitializeVideoRenderer(video_stream());
-
- InitializePipeline(PIPELINE_OK);
- EXPECT_FALSE(metadata_.has_audio);
- EXPECT_TRUE(metadata_.has_video);
-
- EXPECT_EQ(kStartTime, pipeline_->GetMediaTime());
-}
-
static void RunTimeCB(const AudioRenderer::TimeCB& time_cb,
int time_in_ms,
int max_time_in_ms) {
« no previous file with comments | « media/base/pipeline.cc ('k') | media/filters/chunk_demuxer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698