diff options
author | scherkus <scherkus@chromium.org> | 2014-08-28 18:50:24 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-08-29 01:51:44 +0000 |
commit | d6f1e09b967d780c72d68fc1869a50ffdf74bd66 (patch) | |
tree | bc2c7eace4686a30f32ef795347cf6800331a2b0 /media | |
parent | d52c4a886bbb02a6be4d6009eedacdaf1f84043a (diff) | |
download | chromium_src-d6f1e09b967d780c72d68fc1869a50ffdf74bd66.zip chromium_src-d6f1e09b967d780c72d68fc1869a50ffdf74bd66.tar.gz chromium_src-d6f1e09b967d780c72d68fc1869a50ffdf74bd66.tar.bz2 |
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}
Diffstat (limited to 'media')
-rw-r--r-- | media/filters/pipeline_integration_test.cc | 22 | ||||
-rw-r--r-- | media/test/data/bear_audio_longer_than_video.ogv | bin | 0 -> 62810 bytes | |||
-rw-r--r-- | media/test/data/bear_audio_shorter_than_video.ogv | bin | 0 -> 52472 bytes |
3 files changed, 22 insertions, 0 deletions
diff --git a/media/filters/pipeline_integration_test.cc b/media/filters/pipeline_integration_test.cc index b0237eb..f5b6350 100644 --- a/media/filters/pipeline_integration_test.cc +++ b/media/filters/pipeline_integration_test.cc @@ -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 diff --git a/media/test/data/bear_audio_longer_than_video.ogv b/media/test/data/bear_audio_longer_than_video.ogv Binary files differnew file mode 100644 index 0000000..bb75b19 --- /dev/null +++ b/media/test/data/bear_audio_longer_than_video.ogv diff --git a/media/test/data/bear_audio_shorter_than_video.ogv b/media/test/data/bear_audio_shorter_than_video.ogv Binary files differnew file mode 100644 index 0000000..66e9cc9 --- /dev/null +++ b/media/test/data/bear_audio_shorter_than_video.ogv |