| 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));
|
|
|