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 945 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
956 source.EndOfStream(); | 956 source.EndOfStream(); |
957 | 957 |
958 EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size()); | 958 EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size()); |
959 EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds()); | 959 EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds()); |
960 EXPECT_EQ(313, pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds()); | 960 EXPECT_EQ(313, pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds()); |
961 | 961 |
962 Play(); | 962 Play(); |
963 | 963 |
964 EXPECT_TRUE(WaitUntilOnEnded()); | 964 EXPECT_TRUE(WaitUntilOnEnded()); |
965 | 965 |
966 // Verify that codec delay was stripped, if it wasn't the hash would be: | 966 // Verify that codec delay was stripped. |
967 // "5.16,1.25,7.78,4.29,8.98,2.76," | 967 EXPECT_EQ("1.01,2.71,4.18,4.32,3.04,1.12,", GetAudioHash()); |
968 EXPECT_EQ("5.81,2.71,8.97,4.32,7.83,1.12,", GetAudioHash()); | |
969 } | 968 } |
970 | 969 |
971 TEST_P(PipelineIntegrationTest, MediaSource_MP3_TimestampOffset) { | 970 TEST_P(PipelineIntegrationTest, MediaSource_MP3_TimestampOffset) { |
972 MockMediaSource source("sfx.mp3", kMP3, kAppendWholeFile, GetParam()); | 971 MockMediaSource source("sfx.mp3", kMP3, kAppendWholeFile, GetParam()); |
973 StartPipelineWithMediaSource(&source); | 972 StartPipelineWithMediaSource(&source); |
974 EXPECT_EQ(313, source.last_timestamp_offset().InMilliseconds()); | 973 EXPECT_EQ(313, source.last_timestamp_offset().InMilliseconds()); |
975 | 974 |
976 // There are 576 silent frames at the start of this mp3. The second append | 975 // There are 576 silent frames at the start of this mp3. The second append |
977 // should trim them off. | 976 // should trim them off. |
978 const base::TimeDelta mp3_preroll_duration = | 977 const base::TimeDelta mp3_preroll_duration = |
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1445 } | 1444 } |
1446 | 1445 |
1447 // For MediaSource tests, generate two sets of tests: one using FrameProcessor, | 1446 // For MediaSource tests, generate two sets of tests: one using FrameProcessor, |
1448 // and one using LegacyFrameProcessor. | 1447 // and one using LegacyFrameProcessor. |
1449 INSTANTIATE_TEST_CASE_P(NewFrameProcessor, PipelineIntegrationTest, | 1448 INSTANTIATE_TEST_CASE_P(NewFrameProcessor, PipelineIntegrationTest, |
1450 Values(false)); | 1449 Values(false)); |
1451 INSTANTIATE_TEST_CASE_P(LegacyFrameProcessor, PipelineIntegrationTest, | 1450 INSTANTIATE_TEST_CASE_P(LegacyFrameProcessor, PipelineIntegrationTest, |
1452 Values(true)); | 1451 Values(true)); |
1453 | 1452 |
1454 } // namespace media | 1453 } // namespace media |
OLD | NEW |