Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(313)

Unified Diff: media/filters/pipeline_integration_test.cc

Issue 517843003: Add tests to verify playback ends when audio/video durations differ. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | media/test/data/bear_audio_longer_than_video.ogv » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/pipeline_integration_test.cc
diff --git a/media/filters/pipeline_integration_test.cc b/media/filters/pipeline_integration_test.cc
index 3f246465339516a35bfae186607016100d6533c6..e9f4b42c9d5fac6775ec9c294e5bb525a07cfaf7 100644
--- a/media/filters/pipeline_integration_test.cc
+++ b/media/filters/pipeline_integration_test.cc
@@ -1555,4 +1555,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
« no previous file with comments | « no previous file | media/test/data/bear_audio_longer_than_video.ogv » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698