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 774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
785 EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds()); | 785 EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds()); |
786 EXPECT_EQ(640, pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds()); | 786 EXPECT_EQ(640, pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds()); |
787 | 787 |
788 Play(); | 788 Play(); |
789 | 789 |
790 EXPECT_TRUE(WaitUntilOnEnded()); | 790 EXPECT_TRUE(WaitUntilOnEnded()); |
791 } | 791 } |
792 | 792 |
793 TEST_P(PipelineIntegrationTest, MediaSource_MP3) { | 793 TEST_P(PipelineIntegrationTest, MediaSource_MP3) { |
794 MockMediaSource source("sfx.mp3", kMP3, kAppendWholeFile, GetParam()); | 794 MockMediaSource source("sfx.mp3", kMP3, kAppendWholeFile, GetParam()); |
795 StartPipelineWithMediaSource(&source); | 795 StartHashedPipelineWithMediaSource(&source); |
796 source.EndOfStream(); | 796 source.EndOfStream(); |
797 | 797 |
798 EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size()); | 798 EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size()); |
799 EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds()); | 799 EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds()); |
800 EXPECT_EQ(339, pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds()); | 800 EXPECT_EQ(339, pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds()); |
801 | 801 |
802 Play(); | 802 Play(); |
803 | 803 |
804 EXPECT_TRUE(WaitUntilOnEnded()); | 804 EXPECT_TRUE(WaitUntilOnEnded()); |
| 805 |
| 806 // Verify that codec delay was stripped, if it wasn't the hash would be: |
| 807 // "5.20,1.88,8.52,4.60,8.62,2.00," |
| 808 EXPECT_EQ("6.58,3.21,8.82,3.64,7.12,1.60,", GetAudioHash()); |
805 } | 809 } |
806 | 810 |
807 TEST_P(PipelineIntegrationTest, MediaSource_MP3_TimestampOffset) { | 811 TEST_P(PipelineIntegrationTest, MediaSource_MP3_TimestampOffset) { |
808 MockMediaSource source("sfx.mp3", kMP3, kAppendWholeFile, GetParam()); | 812 MockMediaSource source("sfx.mp3", kMP3, kAppendWholeFile, GetParam()); |
809 StartPipelineWithMediaSource(&source); | 813 StartPipelineWithMediaSource(&source); |
810 EXPECT_EQ(339, source.last_timestamp_offset().InMilliseconds()); | 814 EXPECT_EQ(339, source.last_timestamp_offset().InMilliseconds()); |
811 | 815 |
812 scoped_refptr<DecoderBuffer> second_file = ReadTestDataFile("sfx.mp3"); | 816 scoped_refptr<DecoderBuffer> second_file = ReadTestDataFile("sfx.mp3"); |
813 source.AppendAtTime( | 817 source.AppendAtTime( |
814 source.last_timestamp_offset() - base::TimeDelta::FromMilliseconds(10), | 818 source.last_timestamp_offset() - base::TimeDelta::FromMilliseconds(10), |
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1215 Play(); | 1219 Play(); |
1216 ASSERT_TRUE(WaitUntilOnEnded()); | 1220 ASSERT_TRUE(WaitUntilOnEnded()); |
1217 } | 1221 } |
1218 | 1222 |
1219 // TODO(wolenetz): Enable MSE testing of new frame processor based on this flag, | 1223 // TODO(wolenetz): Enable MSE testing of new frame processor based on this flag, |
1220 // once the new processor has landed. See http://crbug.com/249422. | 1224 // once the new processor has landed. See http://crbug.com/249422. |
1221 INSTANTIATE_TEST_CASE_P(LegacyFrameProcessor, PipelineIntegrationTest, | 1225 INSTANTIATE_TEST_CASE_P(LegacyFrameProcessor, PipelineIntegrationTest, |
1222 Values(true)); | 1226 Values(true)); |
1223 | 1227 |
1224 } // namespace media | 1228 } // namespace media |
OLD | NEW |