| 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 int kVP9WebMFileDurationMs = 2735; | 63 const int kVP9WebMFileDurationMs = 2703; |
| 64 const int kVP8AWebMFileDurationMs = 2700; | 64 const int kVP8AWebMFileDurationMs = 2700; |
| 65 | 65 |
| 66 #if defined(USE_PROPRIETARY_CODECS) | 66 #if defined(USE_PROPRIETARY_CODECS) |
| 67 const int k640IsoFileDurationMs = 2737; | 67 const int k640IsoFileDurationMs = 2737; |
| 68 const int k640IsoCencFileDurationMs = 2736; | 68 const int k640IsoCencFileDurationMs = 2736; |
| 69 const int k1280IsoFileDurationMs = 2736; | 69 const int k1280IsoFileDurationMs = 2736; |
| 70 const int k1280IsoAVC3FileDurationMs = 2735; | 70 const int k1280IsoAVC3FileDurationMs = 2735; |
| 71 #endif // defined(USE_PROPRIETARY_CODECS) | 71 #endif // defined(USE_PROPRIETARY_CODECS) |
| 72 | 72 |
| 73 // Note: Tests using this class only exercise the DecryptingDemuxerStream path. | 73 // Note: Tests using this class only exercise the DecryptingDemuxerStream path. |
| (...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 510 EXPECT_EQ(k320WebMFileDurationMs, | 510 EXPECT_EQ(k320WebMFileDurationMs, |
| 511 pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds()); | 511 pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds()); |
| 512 | 512 |
| 513 Play(); | 513 Play(); |
| 514 | 514 |
| 515 ASSERT_TRUE(WaitUntilOnEnded()); | 515 ASSERT_TRUE(WaitUntilOnEnded()); |
| 516 source.Abort(); | 516 source.Abort(); |
| 517 Stop(); | 517 Stop(); |
| 518 } | 518 } |
| 519 | 519 |
| 520 // TODO(fgalligan): Enable after new vp9 files are landed. | 520 TEST_F(PipelineIntegrationTest, BasicPlayback_MediaSource_VP9_WebM) { |
| 521 // http://crbug.com/259116 | 521 MockMediaSource source("bear-vp9.webm", kWebMVP9, 67504); |
| 522 TEST_F(PipelineIntegrationTest, | |
| 523 DISABLED_BasicPlayback_MediaSource_VideoOnly_VP9_WebM) { | |
| 524 MockMediaSource source("bear-vp9.webm", kWebMVP9, 32393); | |
| 525 StartPipelineWithMediaSource(&source); | 522 StartPipelineWithMediaSource(&source); |
| 526 source.EndOfStream(); | 523 source.EndOfStream(); |
| 527 | 524 |
| 528 EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size()); | 525 EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size()); |
| 529 EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds()); | 526 EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds()); |
| 530 EXPECT_EQ(kVP9WebMFileDurationMs, | 527 EXPECT_EQ(kVP9WebMFileDurationMs, |
| 531 pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds()); | 528 pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds()); |
| 532 | 529 |
| 533 Play(); | 530 Play(); |
| 534 | 531 |
| (...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1065 PIPELINE_OK)); | 1062 PIPELINE_OK)); |
| 1066 EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size()); | 1063 EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size()); |
| 1067 EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds()); | 1064 EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds()); |
| 1068 EXPECT_EQ(kOpusEndTrimmingWebMFileDurationMs, | 1065 EXPECT_EQ(kOpusEndTrimmingWebMFileDurationMs, |
| 1069 pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds()); | 1066 pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds()); |
| 1070 Play(); | 1067 Play(); |
| 1071 ASSERT_TRUE(WaitUntilOnEnded()); | 1068 ASSERT_TRUE(WaitUntilOnEnded()); |
| 1072 } | 1069 } |
| 1073 | 1070 |
| 1074 // Verify that VP9 video in WebM containers can be played back. | 1071 // Verify that VP9 video in WebM containers can be played back. |
| 1075 // TODO(fgalligan): Enable after new vp9 files are landed. | 1072 TEST_F(PipelineIntegrationTest, BasicPlayback_VideoOnly_VP9_WebM) { |
| 1076 // http://crbug.com/259116 | |
| 1077 TEST_F(PipelineIntegrationTest, DISABLED_BasicPlayback_VideoOnly_VP9_WebM) { | |
| 1078 ASSERT_TRUE(Start(GetTestDataFilePath("bear-vp9.webm"), | 1073 ASSERT_TRUE(Start(GetTestDataFilePath("bear-vp9.webm"), |
| 1079 PIPELINE_OK)); | 1074 PIPELINE_OK)); |
| 1080 Play(); | 1075 Play(); |
| 1081 ASSERT_TRUE(WaitUntilOnEnded()); | 1076 ASSERT_TRUE(WaitUntilOnEnded()); |
| 1082 } | 1077 } |
| 1083 | 1078 |
| 1084 // Verify that VP9 video and Opus audio in the same WebM container can be played | 1079 // Verify that VP9 video and Opus audio in the same WebM container can be played |
| 1085 // back. | 1080 // back. |
| 1086 // TODO(fgalligan): Enable after new vp9 files are landed. | 1081 TEST_F(PipelineIntegrationTest, BasicPlayback_VP9_Opus_WebM) { |
| 1087 // http://crbug.com/259116 | |
| 1088 TEST_F(PipelineIntegrationTest, DISABLED_BasicPlayback_VP9_Opus_WebM) { | |
| 1089 ASSERT_TRUE(Start(GetTestDataFilePath("bear-vp9-opus.webm"), | 1082 ASSERT_TRUE(Start(GetTestDataFilePath("bear-vp9-opus.webm"), |
| 1090 PIPELINE_OK)); | 1083 PIPELINE_OK)); |
| 1091 Play(); | 1084 Play(); |
| 1092 ASSERT_TRUE(WaitUntilOnEnded()); | 1085 ASSERT_TRUE(WaitUntilOnEnded()); |
| 1093 } | 1086 } |
| 1094 | 1087 |
| 1095 // Verify that VP8 video with alpha channel can be played back. | 1088 // Verify that VP8 video with alpha channel can be played back. |
| 1096 TEST_F(PipelineIntegrationTest, BasicPlayback_VP8A_WebM) { | 1089 TEST_F(PipelineIntegrationTest, BasicPlayback_VP8A_WebM) { |
| 1097 EXPECT_CALL(*this, OnSetOpaque(false)).Times(AnyNumber()); | 1090 EXPECT_CALL(*this, OnSetOpaque(false)).Times(AnyNumber()); |
| 1098 ASSERT_TRUE(Start(GetTestDataFilePath("bear-vp8a.webm"), | 1091 ASSERT_TRUE(Start(GetTestDataFilePath("bear-vp8a.webm"), |
| (...skipping 16 matching lines...) Expand all Loading... |
| 1115 // Verify that VP8 video with inband text track can be played back. | 1108 // Verify that VP8 video with inband text track can be played back. |
| 1116 TEST_F(PipelineIntegrationTest, | 1109 TEST_F(PipelineIntegrationTest, |
| 1117 BasicPlayback_VP8_WebVTT_WebM) { | 1110 BasicPlayback_VP8_WebVTT_WebM) { |
| 1118 ASSERT_TRUE(Start(GetTestDataFilePath("bear-vp8-webvtt.webm"), | 1111 ASSERT_TRUE(Start(GetTestDataFilePath("bear-vp8-webvtt.webm"), |
| 1119 PIPELINE_OK)); | 1112 PIPELINE_OK)); |
| 1120 Play(); | 1113 Play(); |
| 1121 ASSERT_TRUE(WaitUntilOnEnded()); | 1114 ASSERT_TRUE(WaitUntilOnEnded()); |
| 1122 } | 1115 } |
| 1123 | 1116 |
| 1124 } // namespace media | 1117 } // namespace media |
| OLD | NEW |