summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorscherkus <scherkus@chromium.org>2014-08-28 18:50:24 -0700
committerCommit bot <commit-bot@chromium.org>2014-08-29 01:51:44 +0000
commitd6f1e09b967d780c72d68fc1869a50ffdf74bd66 (patch)
treebc2c7eace4686a30f32ef795347cf6800331a2b0 /media
parentd52c4a886bbb02a6be4d6009eedacdaf1f84043a (diff)
downloadchromium_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.cc22
-rw-r--r--media/test/data/bear_audio_longer_than_video.ogvbin0 -> 62810 bytes
-rw-r--r--media/test/data/bear_audio_shorter_than_video.ogvbin0 -> 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
new file mode 100644
index 0000000..bb75b19
--- /dev/null
+++ b/media/test/data/bear_audio_longer_than_video.ogv
Binary files differ
diff --git a/media/test/data/bear_audio_shorter_than_video.ogv b/media/test/data/bear_audio_shorter_than_video.ogv
new file mode 100644
index 0000000..66e9cc9
--- /dev/null
+++ b/media/test/data/bear_audio_shorter_than_video.ogv
Binary files differ