Commit d6f1e09b authored by scherkus's avatar scherkus Committed by Commit bot

Add tests to verify playback ends when audio/video durations differ.

In preparation for changing how we compute media time, add some tests to
verify the current behaviour.

BUG=370634

Review URL: https://codereview.chromium.org/517843003

Cr-Commit-Position: refs/heads/master@{#292544}
parent d52c4a88
...@@ -1562,4 +1562,26 @@ TEST_F(PipelineIntegrationTest, BasicPlaybackChainedOggVideo) { ...@@ -1562,4 +1562,26 @@ TEST_F(PipelineIntegrationTest, BasicPlaybackChainedOggVideo) {
EXPECT_EQ(PIPELINE_ERROR_DECODE, WaitUntilEndedOrError()); EXPECT_EQ(PIPELINE_ERROR_DECODE, WaitUntilEndedOrError());
} }
// Tests that we signal ended even when audio runs longer than video track.
TEST_F(PipelineIntegrationTest, BasicPlaybackAudioLongerThanVideo) {
ASSERT_TRUE(Start(GetTestDataFilePath("bear_audio_longer_than_video.ogv"),
PIPELINE_OK));
// Audio track is 2000ms. Video track is 1001ms. Duration should be higher
// of the two.
EXPECT_EQ(2000, pipeline_->GetMediaDuration().InMilliseconds());
Play();
ASSERT_TRUE(WaitUntilOnEnded());
}
// Tests that we signal ended even when audio runs shorter than video track.
TEST_F(PipelineIntegrationTest, BasicPlaybackAudioShorterThanVideo) {
ASSERT_TRUE(Start(GetTestDataFilePath("bear_audio_shorter_than_video.ogv"),
PIPELINE_OK));
// Audio track is 500ms. Video track is 1001ms. Duration should be higher of
// the two.
EXPECT_EQ(1001, pipeline_->GetMediaDuration().InMilliseconds());
Play();
ASSERT_TRUE(WaitUntilOnEnded());
}
} // namespace media } // namespace media
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment