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 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
848 EXPECT_EQ(640, source.last_timestamp_offset().InMilliseconds()); | 848 EXPECT_EQ(640, source.last_timestamp_offset().InMilliseconds()); |
849 EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size()); | 849 EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size()); |
850 EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds()); | 850 EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds()); |
851 EXPECT_EQ(640, pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds()); | 851 EXPECT_EQ(640, pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds()); |
852 | 852 |
853 Play(); | 853 Play(); |
854 | 854 |
855 EXPECT_TRUE(WaitUntilOnEnded()); | 855 EXPECT_TRUE(WaitUntilOnEnded()); |
856 } | 856 } |
857 | 857 |
| 858 TEST_F(PipelineIntegrationTest, BasicPlaybackHashed_MP3) { |
| 859 ASSERT_TRUE(Start(GetTestDataFilePath("sfx.mp3"), PIPELINE_OK, kHashed)); |
| 860 |
| 861 Play(); |
| 862 |
| 863 ASSERT_TRUE(WaitUntilOnEnded()); |
| 864 |
| 865 // Verify codec delay and preroll are stripped. |
| 866 EXPECT_EQ("3.05,2.87,3.00,3.32,3.58,4.08,", GetAudioHash()); |
| 867 } |
| 868 |
858 TEST_P(PipelineIntegrationTest, MediaSource_MP3) { | 869 TEST_P(PipelineIntegrationTest, MediaSource_MP3) { |
859 MockMediaSource source("sfx.mp3", kMP3, kAppendWholeFile, GetParam()); | 870 MockMediaSource source("sfx.mp3", kMP3, kAppendWholeFile, GetParam()); |
860 StartHashedPipelineWithMediaSource(&source); | 871 StartHashedPipelineWithMediaSource(&source); |
861 source.EndOfStream(); | 872 source.EndOfStream(); |
862 | 873 |
863 EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size()); | 874 EXPECT_EQ(1u, pipeline_->GetBufferedTimeRanges().size()); |
864 EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds()); | 875 EXPECT_EQ(0, pipeline_->GetBufferedTimeRanges().start(0).InMilliseconds()); |
865 EXPECT_EQ(313, pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds()); | 876 EXPECT_EQ(313, pipeline_->GetBufferedTimeRanges().end(0).InMilliseconds()); |
866 | 877 |
867 Play(); | 878 Play(); |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1282 Play(); | 1293 Play(); |
1283 ASSERT_TRUE(WaitUntilOnEnded()); | 1294 ASSERT_TRUE(WaitUntilOnEnded()); |
1284 } | 1295 } |
1285 | 1296 |
1286 // TODO(wolenetz): Enable MSE testing of new frame processor based on this flag, | 1297 // TODO(wolenetz): Enable MSE testing of new frame processor based on this flag, |
1287 // once the new processor has landed. See http://crbug.com/249422. | 1298 // once the new processor has landed. See http://crbug.com/249422. |
1288 INSTANTIATE_TEST_CASE_P(LegacyFrameProcessor, PipelineIntegrationTest, | 1299 INSTANTIATE_TEST_CASE_P(LegacyFrameProcessor, PipelineIntegrationTest, |
1289 Values(true)); | 1300 Values(true)); |
1290 | 1301 |
1291 } // namespace media | 1302 } // namespace media |
OLD | NEW |