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

Side by Side 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, 3 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/filters/pipeline_integration_test_base.h" 5 #include "media/filters/pipeline_integration_test_base.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 1537 matching lines...) Expand 10 before | Expand all | Expand 10 after
1548 } 1548 }
1549 1549
1550 // Ensures audio-video playback with missing or negative timestamps fails softly 1550 // Ensures audio-video playback with missing or negative timestamps fails softly
1551 // instead of crashing. See http://crbug.com/396864. 1551 // instead of crashing. See http://crbug.com/396864.
1552 TEST_F(PipelineIntegrationTest, BasicPlaybackChainedOggVideo) { 1552 TEST_F(PipelineIntegrationTest, BasicPlaybackChainedOggVideo) {
1553 ASSERT_TRUE(Start(GetTestDataFilePath("double-bear.ogv"), PIPELINE_OK)); 1553 ASSERT_TRUE(Start(GetTestDataFilePath("double-bear.ogv"), PIPELINE_OK));
1554 Play(); 1554 Play();
1555 EXPECT_EQ(PIPELINE_ERROR_DECODE, WaitUntilEndedOrError()); 1555 EXPECT_EQ(PIPELINE_ERROR_DECODE, WaitUntilEndedOrError());
1556 } 1556 }
1557 1557
1558 // Tests that we signal ended even when audio runs longer than video track.
1559 TEST_F(PipelineIntegrationTest, BasicPlaybackAudioLongerThanVideo) {
1560 ASSERT_TRUE(Start(GetTestDataFilePath("bear_audio_longer_than_video.ogv"),
1561 PIPELINE_OK));
1562 // Audio track is 2000ms. Video track is 1001ms. Duration should be higher
1563 // of the two.
1564 EXPECT_EQ(2000, pipeline_->GetMediaDuration().InMilliseconds());
1565 Play();
1566 ASSERT_TRUE(WaitUntilOnEnded());
1567 }
1568
1569 // Tests that we signal ended even when audio runs shorter than video track.
1570 TEST_F(PipelineIntegrationTest, BasicPlaybackAudioShorterThanVideo) {
1571 ASSERT_TRUE(Start(GetTestDataFilePath("bear_audio_shorter_than_video.ogv"),
1572 PIPELINE_OK));
1573 // Audio track is 500ms. Video track is 1001ms. Duration should be higher of
1574 // the two.
1575 EXPECT_EQ(1001, pipeline_->GetMediaDuration().InMilliseconds());
1576 Play();
1577 ASSERT_TRUE(WaitUntilOnEnded());
1578 }
1579
1558 } // namespace media 1580 } // namespace media
OLDNEW
« 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