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

Unified Diff: media/test/pipeline_integration_test_base.cc

Issue 2645953004: Update duration when demuxed packets exceed known duration. (Closed)
Patch Set: Remove broken CGI server. Rate limit duration changed events. Created 3 years, 11 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
Index: media/test/pipeline_integration_test_base.cc
diff --git a/media/test/pipeline_integration_test_base.cc b/media/test/pipeline_integration_test_base.cc
index f40f590f0bcb73b2ec0c757c5be92beaaae0ec9e..6115e472de8fe8c4af21db49b25b12d4e5cced96 100644
--- a/media/test/pipeline_integration_test_base.cc
+++ b/media/test/pipeline_integration_test_base.cc
@@ -144,13 +144,22 @@ PipelineStatus PipelineIntegrationTestBase::StartInternal(
.Times(AnyNumber());
EXPECT_CALL(*this, OnBufferingStateChange(BUFFERING_HAVE_NOTHING))
.Times(AnyNumber());
- // Permit at most two calls to OnDurationChange. CheckDuration will make sure
- // that no more than one of them is a finite duration. This allows the
- // pipeline to call back at the end of the media with the known duration.
- EXPECT_CALL(*this, OnDurationChange())
- .Times(AtMost(2))
- .WillRepeatedly(
- Invoke(this, &PipelineIntegrationTestBase::CheckDuration));
+ // If the test is expected to have reliable duration information, permit at
+ // most two calls to OnDurationChange. CheckDuration will make sure that no
+ // more than one of them is a finite duration. This allows the pipeline to
+ // call back at the end of the media with the known duration.
+ //
+ // In the event of unreliable duration information, just set the expectation
+ // that it's called at least once. Such streams may repeatedly update their
+ // duration as new packets are demuxed.
+ if (test_type & kUnreliableDuration) {
+ EXPECT_CALL(*this, OnDurationChange()).Times(AtLeast(1));
+ } else {
+ EXPECT_CALL(*this, OnDurationChange())
+ .Times(AtMost(2))
+ .WillRepeatedly(
+ Invoke(this, &PipelineIntegrationTestBase::CheckDuration));
+ }
EXPECT_CALL(*this, OnVideoNaturalSizeChange(_)).Times(AtMost(1));
EXPECT_CALL(*this, OnVideoOpacityChange(_)).WillRepeatedly(Return());
CreateDemuxer(std::move(data_source));

Powered by Google App Engine
This is Rietveld 408576698