Skip to content

Commit

Permalink
Add tests to verify playback ends when audio/video durations differ.
Browse files Browse the repository at this point in the history
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}
  • Loading branch information
scherkus authored and Commit bot committed Aug 29, 2014
1 parent d52c4a8 commit d6f1e09
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions media/filters/pipeline_integration_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1562,4 +1562,26 @@ TEST_F(PipelineIntegrationTest, BasicPlaybackChainedOggVideo) {
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
Binary file added media/test/data/bear_audio_longer_than_video.ogv
Binary file not shown.
Binary file added media/test/data/bear_audio_shorter_than_video.ogv
Binary file not shown.

0 comments on commit d6f1e09

Please sign in to comment.