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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 }; | 53 }; |
54 | 54 |
55 const int kAppendWholeFile = -1; | 55 const int kAppendWholeFile = -1; |
56 | 56 |
57 // Constants for the Media Source config change tests. | 57 // Constants for the Media Source config change tests. |
58 const int kAppendTimeSec = 1; | 58 const int kAppendTimeSec = 1; |
59 const int kAppendTimeMs = kAppendTimeSec * 1000; | 59 const int kAppendTimeMs = kAppendTimeSec * 1000; |
60 const int k320WebMFileDurationMs = 2737; | 60 const int k320WebMFileDurationMs = 2737; |
61 const int k640WebMFileDurationMs = 2763; | 61 const int k640WebMFileDurationMs = 2763; |
62 const int kOpusEndTrimmingWebMFileDurationMs = 2771; | 62 const int kOpusEndTrimmingWebMFileDurationMs = 2771; |
63 const uint32 kOpusEndTrimmingWebMFileAudioBytes = 528676; | |
64 const int kVP9WebMFileDurationMs = 2735; | 63 const int kVP9WebMFileDurationMs = 2735; |
65 const int kVP8AWebMFileDurationMs = 2700; | 64 const int kVP8AWebMFileDurationMs = 2700; |
66 | 65 |
67 #if defined(USE_PROPRIETARY_CODECS) | 66 #if defined(USE_PROPRIETARY_CODECS) |
68 const int k640IsoFileDurationMs = 2737; | 67 const int k640IsoFileDurationMs = 2737; |
69 const int k640IsoCencFileDurationMs = 2736; | 68 const int k640IsoCencFileDurationMs = 2736; |
70 const int k1280IsoFileDurationMs = 2736; | 69 const int k1280IsoFileDurationMs = 2736; |
71 const int k1280IsoAVC3FileDurationMs = 2735; | 70 const int k1280IsoAVC3FileDurationMs = 2735; |
72 #endif // defined(USE_PROPRIETARY_CODECS) | 71 #endif // defined(USE_PROPRIETARY_CODECS) |
73 | 72 |
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 StartPipelineWithMediaSource(&source); | 559 StartPipelineWithMediaSource(&source); |
561 source.EndOfStream(); | 560 source.EndOfStream(); |
562 | 561 |
563 EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size()); | 562 EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size()); |
564 EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds()); | 563 EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds()); |
565 EXPECT_EQ(kOpusEndTrimmingWebMFileDurationMs, | 564 EXPECT_EQ(kOpusEndTrimmingWebMFileDurationMs, |
566 pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds()); | 565 pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds()); |
567 Play(); | 566 Play(); |
568 | 567 |
569 ASSERT_TRUE(WaitUntilOnEnded()); | 568 ASSERT_TRUE(WaitUntilOnEnded()); |
570 EXPECT_EQ(kOpusEndTrimmingWebMFileAudioBytes, | |
571 pipeline_->GetStatistics().audio_bytes_decoded); | |
572 source.Abort(); | 569 source.Abort(); |
573 Stop(); | 570 Stop(); |
574 } | 571 } |
575 | 572 |
576 // Flaky. http://crbug.com/304776 | 573 // Flaky. http://crbug.com/304776 |
577 TEST_F(PipelineIntegrationTest, DISABLED_MediaSource_Opus_Seeking_WebM) { | 574 TEST_F(PipelineIntegrationTest, DISABLED_MediaSource_Opus_Seeking_WebM) { |
578 EXPECT_CALL(*this, OnSetOpaque(false)).Times(AnyNumber()); | 575 EXPECT_CALL(*this, OnSetOpaque(false)).Times(AnyNumber()); |
579 MockMediaSource source("bear-opus-end-trimming.webm", kOpusAudioOnlyWebM, | 576 MockMediaSource source("bear-opus-end-trimming.webm", kOpusAudioOnlyWebM, |
580 kAppendWholeFile); | 577 kAppendWholeFile); |
581 StartHashedPipelineWithMediaSource(&source); | 578 StartHashedPipelineWithMediaSource(&source); |
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1056 32768, | 1053 32768, |
1057 base::TimeDelta::FromMilliseconds(200), | 1054 base::TimeDelta::FromMilliseconds(200), |
1058 base::TimeDelta::FromMilliseconds(1668), | 1055 base::TimeDelta::FromMilliseconds(1668), |
1059 0x1C896, 65536)); | 1056 0x1C896, 65536)); |
1060 } | 1057 } |
1061 | 1058 |
1062 // Verify that Opus audio in WebM containers can be played back. | 1059 // Verify that Opus audio in WebM containers can be played back. |
1063 TEST_F(PipelineIntegrationTest, BasicPlayback_AudioOnly_Opus_WebM) { | 1060 TEST_F(PipelineIntegrationTest, BasicPlayback_AudioOnly_Opus_WebM) { |
1064 ASSERT_TRUE(Start(GetTestDataFilePath("bear-opus-end-trimming.webm"), | 1061 ASSERT_TRUE(Start(GetTestDataFilePath("bear-opus-end-trimming.webm"), |
1065 PIPELINE_OK)); | 1062 PIPELINE_OK)); |
| 1063 EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size()); |
| 1064 EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds()); |
| 1065 EXPECT_EQ(kOpusEndTrimmingWebMFileDurationMs, |
| 1066 pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds()); |
1066 Play(); | 1067 Play(); |
1067 ASSERT_TRUE(WaitUntilOnEnded()); | 1068 ASSERT_TRUE(WaitUntilOnEnded()); |
1068 EXPECT_EQ(kOpusEndTrimmingWebMFileAudioBytes, | |
1069 pipeline_->GetStatistics().audio_bytes_decoded); | |
1070 } | 1069 } |
1071 | 1070 |
1072 // Verify that VP9 video in WebM containers can be played back. | 1071 // Verify that VP9 video in WebM containers can be played back. |
1073 // TODO(fgalligan): Enable after new vp9 files are landed. | 1072 // TODO(fgalligan): Enable after new vp9 files are landed. |
1074 // http://crbug.com/259116 | 1073 // http://crbug.com/259116 |
1075 TEST_F(PipelineIntegrationTest, DISABLED_BasicPlayback_VideoOnly_VP9_WebM) { | 1074 TEST_F(PipelineIntegrationTest, DISABLED_BasicPlayback_VideoOnly_VP9_WebM) { |
1076 ASSERT_TRUE(Start(GetTestDataFilePath("bear-vp9.webm"), | 1075 ASSERT_TRUE(Start(GetTestDataFilePath("bear-vp9.webm"), |
1077 PIPELINE_OK)); | 1076 PIPELINE_OK)); |
1078 Play(); | 1077 Play(); |
1079 ASSERT_TRUE(WaitUntilOnEnded()); | 1078 ASSERT_TRUE(WaitUntilOnEnded()); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1113 // Verify that VP8 video with inband text track can be played back. | 1112 // Verify that VP8 video with inband text track can be played back. |
1114 TEST_F(PipelineIntegrationTest, | 1113 TEST_F(PipelineIntegrationTest, |
1115 BasicPlayback_VP8_WebVTT_WebM) { | 1114 BasicPlayback_VP8_WebVTT_WebM) { |
1116 ASSERT_TRUE(Start(GetTestDataFilePath("bear-vp8-webvtt.webm"), | 1115 ASSERT_TRUE(Start(GetTestDataFilePath("bear-vp8-webvtt.webm"), |
1117 PIPELINE_OK)); | 1116 PIPELINE_OK)); |
1118 Play(); | 1117 Play(); |
1119 ASSERT_TRUE(WaitUntilOnEnded()); | 1118 ASSERT_TRUE(WaitUntilOnEnded()); |
1120 } | 1119 } |
1121 | 1120 |
1122 } // namespace media | 1121 } // namespace media |
OLD | NEW |