OLD | NEW |
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 Loading... |
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 |
OLD | NEW |